<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/39/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Enovationdevteam</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/39/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Enovationdevteam"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/Special:Contributions/Enovationdevteam"/>
	<updated>2026-05-15T19:47:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ad-hoc_contributed_reports&amp;diff=138960</id>
		<title>ad-hoc contributed reports</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ad-hoc_contributed_reports&amp;diff=138960"/>
		<updated>2021-09-03T08:59:16Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* Most Active courses */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Sitewide reports}}&lt;br /&gt;
==User and Role Report==&lt;br /&gt;
&lt;br /&gt;
===Count number of distinct learners and teachers enrolled per category (including all its sub categories)===&lt;br /&gt;
&amp;lt;code sql&amp;gt;SELECT COUNT(DISTINCT lra.userid) AS learners, COUNT(DISTINCT tra.userid) as teachers&lt;br /&gt;
FROM prefix_course AS c #, mdl_course_categories AS cats&lt;br /&gt;
LEFT JOIN prefix_context AS ctx ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_role_assignments  AS lra ON lra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_role_assignments  AS tra ON tra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_course_categories AS cats ON c.category = cats.id&lt;br /&gt;
WHERE c.category = cats.id&lt;br /&gt;
AND (&lt;br /&gt;
	cats.path LIKE &#039;%/CATEGORYID/%&#039; #Replace CATEGORYID with the category id you want to count (eg: 80)&lt;br /&gt;
	OR cats.path LIKE &#039;%/CATEGORYID&#039;&lt;br /&gt;
	)&lt;br /&gt;
AND lra.roleid=5&lt;br /&gt;
AND tra.roleid=3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Detailed ACTIONs for each ROLE (TEACHER, NON-EDITING TEACHER and STUDENT)===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT r.name, l.action, COUNT( l.userid ) AS counter&lt;br /&gt;
FROM prefix_log AS l&lt;br /&gt;
JOIN prefix_context AS context ON context.instanceid = l.course AND context.contextlevel = 50&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON l.userid = ra.userid AND ra.contextid = context.id&lt;br /&gt;
JOIN prefix_role AS r ON ra.roleid = r.id&lt;br /&gt;
WHERE ra.roleid IN ( 3, 4, 5 ) &lt;br /&gt;
GROUP BY roleid, l.action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Student (user) COUNT in each Course===&lt;br /&gt;
Including (optional) filter by: year (if included in course fullname).&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,course.id,&#039;&amp;quot;&amp;gt;&#039;,course.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
,CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/user/index.php?contextid=&#039;,context.id,&#039;&amp;quot;&amp;gt;Show users&amp;lt;/a&amp;gt;&#039;) AS Users&lt;br /&gt;
, COUNT(course.id) AS Students&lt;br /&gt;
FROM prefix_role_assignments AS asg&lt;br /&gt;
JOIN prefix_context AS context ON asg.contextid = context.id AND context.contextlevel = 50&lt;br /&gt;
JOIN prefix_user AS user ON user.id = asg.userid&lt;br /&gt;
JOIN prefix_course AS course ON context.instanceid = course.id&lt;br /&gt;
WHERE asg.roleid = 5 &lt;br /&gt;
# AND course.fullname LIKE &#039;%2013%&#039;&lt;br /&gt;
GROUP BY course.id&lt;br /&gt;
ORDER BY COUNT(course.id) DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enrolment count in each Course ===&lt;br /&gt;
&lt;br /&gt;
Shows the total number of enroled users of all roles in each course. Sorted by course name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.fullname, COUNT(ue.id) AS Enroled&lt;br /&gt;
FROM prefix_course AS c &lt;br /&gt;
JOIN prefix_enrol AS en ON en.courseid = c.id&lt;br /&gt;
JOIN prefix_user_enrolments AS ue ON ue.enrolid = en.id&lt;br /&gt;
GROUP BY c.id&lt;br /&gt;
ORDER BY c.fullname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LIST of all site USERS by COURSE enrollment (Moodle 2.x)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
user2.firstname AS Firstname,&lt;br /&gt;
user2.lastname AS Lastname,&lt;br /&gt;
user2.email AS Email,&lt;br /&gt;
user2.city AS City,&lt;br /&gt;
course.fullname AS Course&lt;br /&gt;
,(SELECT shortname FROM prefix_role WHERE id=en.roleid) as Role&lt;br /&gt;
,(SELECT name FROM prefix_role WHERE id=en.roleid) as RoleName&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course as course &lt;br /&gt;
JOIN prefix_enrol AS en ON en.courseid = course.id&lt;br /&gt;
JOIN prefix_user_enrolments AS ue ON ue.enrolid = en.id&lt;br /&gt;
JOIN prefix_user AS user2 ON ue.userid = user2.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Enrolled users,which did not login into the Course, even once (Moodle 2)===&lt;br /&gt;
Designed forMoodle 2 table structure and uses special plugin filter : %%FILTER_SEARCHTEXT:table.field%%&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
user2.id as ID,&lt;br /&gt;
ul.timeaccess,&lt;br /&gt;
user2.firstname AS Firstname,&lt;br /&gt;
user2.lastname AS Lastname,&lt;br /&gt;
user2.email AS Email,&lt;br /&gt;
user2.city AS City,&lt;br /&gt;
user2.idnumber AS IDNumber,&lt;br /&gt;
user2.phone1 AS Phone,&lt;br /&gt;
user2.institution AS Institution,&lt;br /&gt;
&lt;br /&gt;
IF (user2.lastaccess = 0,&#039;never&#039;,&lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(user2.lastaccess),&#039;%Y-%m-%d&#039;)) AS dLastAccess&lt;br /&gt;
&lt;br /&gt;
,(SELECT DATE_FORMAT(FROM_UNIXTIME(timeaccess),&#039;%Y-%m-%d&#039;) FROM prefix_user_lastaccess WHERE userid=user2.id and courseid=c.id) as CourseLastAccess&lt;br /&gt;
&lt;br /&gt;
,(SELECT r.name&lt;br /&gt;
FROM  prefix_user_enrolments AS uenrol&lt;br /&gt;
JOIN prefix_enrol AS e ON e.id = uenrol.enrolid&lt;br /&gt;
JOIN prefix_role AS r ON e.id = r.id&lt;br /&gt;
WHERE uenrol.userid=user2.id and e.courseid = c.id) AS RoleName&lt;br /&gt;
&lt;br /&gt;
FROM prefix_user_enrolments as ue&lt;br /&gt;
JOIN prefix_enrol as e on e.id = ue.enrolid&lt;br /&gt;
JOIN prefix_course as c ON c.id = e.courseid&lt;br /&gt;
JOIN prefix_user as user2 ON user2 .id = ue.userid&lt;br /&gt;
LEFT JOIN prefix_user_lastaccess as ul on ul.userid = user2.id&lt;br /&gt;
WHERE c.id=16 AND ul.timeaccess IS NULL&lt;br /&gt;
%%FILTER_SEARCHTEXT:user2.firstname%%&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Enrolled users who have never accessed a given course (simpler version)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT username, firstname, lastname, idnumber&lt;br /&gt;
FROM prefix_user_enrolments ue&lt;br /&gt;
JOIN prefix_enrol en ON ue.enrolid = en.id&lt;br /&gt;
JOIN prefix_user uu ON uu.id = ue.userid &lt;br /&gt;
WHERE en.courseid = 123456&lt;br /&gt;
AND NOT EXISTS (&lt;br /&gt;
    SELECT * FROM prefix_user_lastaccess la&lt;br /&gt;
    WHERE la.userid = ue.userid&lt;br /&gt;
    AND la.courseid = en.courseid&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Replace 123456 near the middle with your courseid)&lt;br /&gt;
&lt;br /&gt;
===Role assignments on categories===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/category.php?id=&#039;,cc.id,&#039;&amp;quot;&amp;gt;&#039;,cc.id,&#039;&amp;lt;/a&amp;gt;&#039;) AS id,&lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/category.php?id=&#039;,cc.id,&#039;&amp;quot;&amp;gt;&#039;,cc.name,&#039;&amp;lt;/a&amp;gt;&#039;) AS category,&lt;br /&gt;
cc.depth, cc.path, r.name AS role,&lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/user/view.php?id=&#039;,usr.id,&#039;&amp;quot;&amp;gt;&#039;,usr.lastname,&#039;&amp;lt;/a&amp;gt;&#039;) AS name,&lt;br /&gt;
usr.firstname, usr.username, usr.email&lt;br /&gt;
FROM prefix_course_categories cc&lt;br /&gt;
INNER JOIN prefix_context cx ON cc.id = cx.instanceid&lt;br /&gt;
AND cx.contextlevel = &#039;40&#039;&lt;br /&gt;
INNER JOIN prefix_role_assignments ra ON cx.id = ra.contextid&lt;br /&gt;
INNER JOIN prefix_role r ON ra.roleid = r.id&lt;br /&gt;
INNER JOIN prefix_user usr ON ra.userid = usr.id&lt;br /&gt;
ORDER BY cc.depth, cc.path, usr.lastname, usr.firstname, r.name, cc.name&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Permissions Overides on Categories===&lt;br /&gt;
(By: [http://moodle.org/mod/forum/discuss.php?d=153059#p712834 Séverin Terrier] )&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT rc.id, ct.instanceid, ccat.name, rc.roleid, rc.capability, rc.permission, &lt;br /&gt;
DATE_FORMAT( FROM_UNIXTIME( rc.timemodified ) , &#039;%Y-%m-%d&#039; ) AS timemodified, rc.modifierid, ct.instanceid, ct.path, ct.depth&lt;br /&gt;
FROM `prefix_role_capabilities` AS rc&lt;br /&gt;
INNER JOIN `prefix_context` AS ct ON rc.contextid = ct.id&lt;br /&gt;
INNER JOIN `prefix_course_categories` AS ccat ON ccat.id = ct.instanceid&lt;br /&gt;
AND `contextlevel` =40&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lists &amp;quot;Totally Opened Courses&amp;quot; (visible, opened to guests, with no password)===&lt;br /&gt;
(By: [http://moodle.org/mod/forum/discuss.php?d=153059#p712837 Séverin Terrier] )&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.id,&#039;&amp;lt;/a&amp;gt;&#039;) AS id,&lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.shortname,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Course&#039;,&lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/enrol/instances.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;Méthodes inscription&amp;lt;/a&amp;gt;&#039;) AS &#039;Enrollment plugins&#039;,&lt;br /&gt;
e.sortorder&lt;br /&gt;
FROM prefix_enrol AS e, prefix_course AS c&lt;br /&gt;
WHERE e.enrol=&#039;guest&#039; AND e.status=0 AND e.password=&#039;&#039; AND c.id=e.courseid AND c.visible=1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lists &amp;quot;loggedin users&amp;quot; from the last 120 days===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT id,username,FROM_UNIXTIME(`lastlogin`) as days &lt;br /&gt;
FROM `prefix_user` &lt;br /&gt;
WHERE DATEDIFF( NOW(),FROM_UNIXTIME(`lastlogin`) ) &amp;lt; 120&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;and user count for that same population:&#039;&#039;&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT COUNT(id) as Users  FROM `prefix_user` &lt;br /&gt;
WHERE DATEDIFF( NOW(),FROM_UNIXTIME(`lastlogin`) ) &amp;lt; 120&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Users loggedin within the last 7 days ====&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
    l.* FROM mdl_logstore_standard_log l&lt;br /&gt;
WHERE&lt;br /&gt;
   l.eventname = &#039;\\core\\event\\user_loggedin&#039;&lt;br /&gt;
   AND FROM_UNIXTIME(l.timecreated, &#039;%Y-%m-%d&#039;) &amp;gt;= DATE_SUB(NOW(), INTERVAL 7 DAY)&lt;br /&gt;
&lt;br /&gt;
SELECT l.eventname FROM mdl_logstore_standard_log l&lt;br /&gt;
GROUP BY l.eventname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lists the users who have only logged into the site once===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT id, username, firstname, lastname, idnumber&lt;br /&gt;
FROM prefix_user&lt;br /&gt;
WHERE prefix_user.deleted = 0&lt;br /&gt;
AND prefix_user.lastlogin = 0 &lt;br /&gt;
AND prefix_user.lastaccess &amp;gt; 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Students in all courses of some institute===&lt;br /&gt;
What is the status (deleted or not) of all Students (roleid = 5) in all courses of some Institute&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.id, c.fullname, u.firstname, u.lastname, u.deleted&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_context AS ctx ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE ra.roleid =5&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
AND u.institution = &#039;please enter school name here&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Full User info (for deleted users)===&lt;br /&gt;
Including extra custom profile fields (from prefix_user_info_data)&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT * &lt;br /&gt;
FROM prefix_user as u &lt;br /&gt;
JOIN prefix_user_info_data as uid ON uid.userid = u.id &lt;br /&gt;
JOIN prefix_user_info_field as uif ON (uid.fieldid = uif.id AND uif.shortname = &#039;class&#039;)&lt;br /&gt;
WHERE `deleted` = &amp;quot;1&amp;quot; and `institution`=&amp;quot;your school name&amp;quot; and `department` = &amp;quot;your department&amp;quot; and `data` = &amp;quot;class level and number&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===User&#039;s courses===&lt;br /&gt;
change &amp;quot;u.id = 2&amp;quot; with a new user id&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.firstname, u.lastname, c.id, c.fullname&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_context AS ctx ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE u.id = 2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List Users with extra info (email) in current course===&lt;br /&gt;
blocks/configurable_reports replaces %%COURSEID%% with course id.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.firstname, u.lastname, u.email&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS context ON context.id = ra.contextid AND context.contextlevel = 50&lt;br /&gt;
JOIN prefix_course AS c ON c.id = context.instanceid AND c.id = %%COURSEID%%&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List Students with enrollment and completion dates in current course===&lt;br /&gt;
This is meant to be a &amp;quot;global&amp;quot; report in Configurable Reports containing the following:&lt;br /&gt;
firstname, lastname, idnumber, institution, department, email, student enrolment date, student completion date&lt;br /&gt;
Note: for PGSQL, use to_timestamp() instead of FROM_UNIXTIME()&lt;br /&gt;
Contributed by Elizabeth Dalton, Moodle HQ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
u.firstname&lt;br /&gt;
, u.lastname&lt;br /&gt;
, u.idnumber&lt;br /&gt;
, u.institution&lt;br /&gt;
, u.department&lt;br /&gt;
, u.email&lt;br /&gt;
, FROM_UNIXTIME(cc.timeenrolled)&lt;br /&gt;
, FROM_UNIXTIME(cc.timecompleted)&lt;br /&gt;
&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS context ON context.id = ra.contextid AND context.contextlevel = 50&lt;br /&gt;
JOIN prefix_course AS c ON c.id = context.instanceid AND c.id = %%COURSEID%%&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_course_completions AS cc ON cc.course = c.id AND cc.userid = u.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Special Roles===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT ra.roleid,r.name&lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/user.php?id=1&amp;amp;user=&#039;,ra.userid,&#039;&amp;quot;&amp;gt;&#039;,u.firstname ,&#039; &#039;,u.lastname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Username&lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_role AS r ON r.id = ra.roleid&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_context AS ctx ON (ctx.id = ra.contextid AND ctx.contextlevel = 50)&lt;br /&gt;
JOIN prefix_course AS c ON ctx.instanceid = c.id&lt;br /&gt;
WHERE ra.roleid &amp;gt; 6&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Courses without Teachers===&lt;br /&gt;
Actually, shows the number of Teachers in a course.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) as Course&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id) AS Teachers&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
ORDER BY Teachers ASC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List of users who have been enrolled for more than 4 weeks===&lt;br /&gt;
For Moodle 2.2 , by  Isuru Madushanka Weerarathna &lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT uenr.userid As User, IF(enr.courseid=uenr.courseid ,&#039;Y&#039;,&#039;N&#039;) As Enrolled, &lt;br /&gt;
IF(DATEDIFF(NOW(), FROM_UNIXTIME(uenr.timecreated))&amp;gt;=28,&#039;Y&#039;,&#039;N&#039;) As EnrolledMoreThan4Weeks&lt;br /&gt;
FROM prefix_enrol As enr, prefix_user_enrolments AS uenr&lt;br /&gt;
WHERE enr.id = uenr.enrolid AND enr.status = uenr.status&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of users with language===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
An issue with systems that do not have their default language set up properly is the need to do a mass change for all users to a localization. A common case (in the U.S., Canada and the Americas) is changing the default English to United States English. &lt;br /&gt;
&lt;br /&gt;
This will show you the language setting for all users:&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT username, lang from prefix_user &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: UPDATE commands require the ability to alter the database directly via tools like Adminer or PHPMyAdmin or other db tools.&lt;br /&gt;
&lt;br /&gt;
This code will change the setting from &#039;en&#039; to &#039;en_us&#039; for all users:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
UPDATE prefix_user SET lang = &#039;en_us&#039; WHERE lang = &#039;en&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To do this for only users who have a particular country set, use this as an example:&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
UPDATE prefix_user SET lang = &#039;en_us&#039; WHERE country = &#039;US&#039; AND lang = &#039;en&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of users with Authentication ===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
Sometimes you need to do mass changes of authentication methods. A common case is changing default manual to LDAP. &lt;br /&gt;
&lt;br /&gt;
This will show you the Authentication setting for all users:&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT username, auth from prefix_user &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: UPDATE commands require the ability to alter the database directly via tools like Adminer or PHPMyAdmin or other db tools. &lt;br /&gt;
&lt;br /&gt;
This code will change the setting from &#039;manual&#039; to &#039;ldap&#039; for all users except for the first two accounts which are Guest and Admin. (WARNING: it is bad practice to change your admin account from manual to an external method as failure of that external method will lock you out of Moodle as admin.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
UPDATE prefix_user SET auth = &#039;ldap&#039; WHERE auth = &#039;manual&#039; AND id &amp;gt; 2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compare role capability and permissions ===&lt;br /&gt;
Compatibility: MySQL and PostgreSQL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT DISTINCT mrc.capability &lt;br /&gt;
,(SELECT &#039;X&#039; FROM prefix_role_capabilities AS rc WHERE rc.capability = mrc.capability AND rc.roleid = &#039;1&#039; AND rc.contextid = &#039;1&#039;) AS Manager&lt;br /&gt;
,(SELECT &#039;X&#039; FROM prefix_role_capabilities AS rc WHERE rc.capability = mrc.capability AND rc.roleid = &#039;2&#039; AND rc.contextid = &#039;1&#039;) AS Course_Creator&lt;br /&gt;
,(SELECT &#039;X&#039; FROM prefix_role_capabilities AS rc WHERE rc.capability = mrc.capability AND rc.roleid = &#039;3&#039; AND rc.contextid = &#039;1&#039;) AS Teacher&lt;br /&gt;
,(SELECT &#039;X&#039; FROM prefix_role_capabilities AS rc WHERE rc.capability = mrc.capability AND rc.roleid = &#039;4&#039; AND rc.contextid = &#039;1&#039;) AS Assistant_Teacher&lt;br /&gt;
,(SELECT &#039;X&#039; FROM prefix_role_capabilities AS rc WHERE rc.capability = mrc.capability AND rc.roleid = &#039;5&#039; AND rc.contextid = &#039;1&#039;) AS Student&lt;br /&gt;
,(SELECT &#039;X&#039; FROM prefix_role_capabilities AS rc WHERE rc.capability = mrc.capability AND rc.roleid = &#039;6&#039; AND rc.contextid = &#039;1&#039;) AS Guest&lt;br /&gt;
,(SELECT &#039;X&#039; FROM prefix_role_capabilities AS rc WHERE rc.capability = mrc.capability AND rc.roleid = &#039;7&#039; AND rc.contextid = &#039;1&#039;) AS Authenticated&lt;br /&gt;
,(SELECT &#039;X&#039; FROM prefix_role_capabilities AS rc WHERE rc.capability = mrc.capability AND rc.roleid = &#039;8&#039; AND rc.contextid = &#039;1&#039;) AS Auth_front&lt;br /&gt;
FROM prefix_role_capabilities AS mrc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== User&#039;s accumulative time spent in course ===&lt;br /&gt;
A sum up of the time delta between logstore_standard_log user&#039;s records, considering the a 2 hour session limit.&lt;br /&gt;
&lt;br /&gt;
Uses: current user&#039;s id %%USERID%% and current course&#039;s id %%COURSEID%%  &lt;br /&gt;
&lt;br /&gt;
And also using a date filter (which can be ignored)  &lt;br /&gt;
&lt;br /&gt;
The extra &amp;quot;User&amp;quot; field is used as a dummy field for the Line chart Series field, in which I use X=id, Series=Type, Y=delta.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
l.id, &lt;br /&gt;
l.timecreated, &lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(l.timecreated),&#039;%d-%m-%Y&#039;) AS dTime,&lt;br /&gt;
@prevtime := (SELECT max(timecreated) FROM mdl_logstore_standard_log &lt;br /&gt;
		WHERE userid = %%USERID%% and id &amp;lt; l.id ORDER BY id ASC LIMIT 1) AS prev_time,&lt;br /&gt;
IF (l.timecreated - @prevtime &amp;lt; 7200, @delta := @delta + (l.timecreated-@prevtime),0) AS sumtime,&lt;br /&gt;
l.timecreated-@prevtime AS delta,&lt;br /&gt;
&amp;quot;User&amp;quot; as type&lt;br /&gt;
&lt;br /&gt;
FROM prefix_logstore_standard_log as l, &lt;br /&gt;
(SELECT @delta := 0) AS s_init &lt;br /&gt;
# Change UserID&lt;br /&gt;
WHERE l.userid = %%USERID%% AND l.courseid = %%COURSEID%%&lt;br /&gt;
%%FILTER_STARTTIME:l.timecreated:&amp;gt;%% %%FILTER_ENDTIME:l.timecreated:&amp;lt;%% &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Low-Participation Student Report ===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College / Moodle HQ&lt;br /&gt;
&lt;br /&gt;
This report returns a list of students who are enrolled in courses filtered by a short-name text marker (in this case &amp;quot;OL-&amp;quot;) in the specified category, but have very low participation in the course during the specified time period (fewer than 2 &amp;quot;Edits&amp;quot; to Activity Modules, indicating few active contributions to the course). The number of &amp;quot;Edits&amp;quot; is provided for each student for the time period specified.&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;Edit&amp;quot; is defined as course activity other than viewing content. Click the &amp;quot;Logs&amp;quot; link to review the student activity. The Logs offer the option to review &amp;quot;View&amp;quot; activity as well as &amp;quot;Edit&amp;quot; activity.&lt;br /&gt;
&lt;br /&gt;
Only &amp;quot;visible&amp;quot; courses are included in this report. The report may be downloaded as an Excel spreadsheet.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to set up Filters: &amp;quot;Start / End date filter&amp;quot; and &amp;quot;Filter categories&amp;quot; on the Filters tab in Configurable reports.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.lastname AS Last, u.firstname AS First, u.idnumber AS IDnumber, u.email AS email, c.shortname AS CourseID,  count(l.id) AS Edits, CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;https://learn.granite.edu/report/log/index.php&#039;,CHAR(63),&#039;chooselog=1&amp;amp;showusers=1&amp;amp;showcourses=0&amp;amp;id=&#039;,c.id,&#039;&amp;amp;user=&#039;,u.id,&#039;&amp;amp;date=0&amp;amp;modid=&amp;amp;modaction=-view&amp;amp;logformat=showashtml&#039;,&#039;&amp;quot;&amp;gt;&#039;,&#039;Logs&#039;,&#039;&amp;lt;/a&amp;gt;&#039;) AS Link&lt;br /&gt;
&lt;br /&gt;
FROM prefix_user AS u&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = ctx.instanceid&lt;br /&gt;
&lt;br /&gt;
LEFT JOIN prefix_log AS l ON l.userid = u.id AND l.course = c.id AND l.action NOT LIKE &amp;quot;view%&amp;quot; %%FILTER_STARTTIME:l.TIME:&amp;gt;%% %%FILTER_ENDTIME:l.TIME:&amp;lt;%%&lt;br /&gt;
&lt;br /&gt;
WHERE ra.roleid =5&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
AND c.visible=1&lt;br /&gt;
# This prefix filter allows the exclusion of non-online courses at the original institution. Alter this to fit your institution, or remove it.&lt;br /&gt;
AND c.shortname LIKE &#039;%OL-%&#039;&lt;br /&gt;
%%FILTER_CATEGORIES:c.category%%&lt;br /&gt;
&lt;br /&gt;
GROUP BY u.idnumber&lt;br /&gt;
&lt;br /&gt;
HAVING Edits &amp;lt; 2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Messages of All Users in a Specific Course ===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
NOTE: This query will probably not work at all in 3.5 now due to the changes in the structure of the Messages database. - RT&lt;br /&gt;
&lt;br /&gt;
This query shows the personal messages between users in a specific course, given the course id number. Properly speaking, personal messages pertain only to users and are not part of courses, but by filtering enrollments for roles in a course, you can show this. &lt;br /&gt;
&lt;br /&gt;
This report as is shows only the messages between Teachers and Students, as the WHERE statement contains and AND ((...))) section that restrict this report to ONLY messages between Teachers (role id = 3) and Students (role id =5). Remove that part of the statement if you wish to see _all_ messages between all users, e.g. teachers to teachers, student to student. &lt;br /&gt;
&lt;br /&gt;
Also, if you have created custom roles, you can replace the default id numbers with custom ones to further enhance the report.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
u.username AS &#039;From&#039;,&lt;br /&gt;
CONCAT(u.firstname ,&#039; &#039;,u.lastname) AS &#039;From Name&#039;,&lt;br /&gt;
u2.username AS &#039;To&#039;,&lt;br /&gt;
CONCAT(u2.firstname ,&#039; &#039;,u2.lastname) AS &#039;To Name&#039;,&lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(me.timecreated), &#039;%Y-%m-%d %H:%i&#039;) AS &#039;When&#039;,&lt;br /&gt;
me.subject AS &#039;Subject&#039;, &lt;br /&gt;
me.smallmessage AS &#039;Message&#039;&lt;br /&gt;
FROM prefix_message me&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.userid = me.useridfrom AND ra.roleid IN (3,4,5)  &lt;br /&gt;
JOIN prefix_role_assignments AS ra2 ON ra2.userid = me.useridto AND ra2.roleid IN (3,4,5)  &lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id AND ra2.contextid = ctx.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_user u ON u.id = me.useridfrom&lt;br /&gt;
JOIN prefix_user u2 ON u2.id = me.useridto&lt;br /&gt;
WHERE c.id=## &lt;br /&gt;
AND ((ra.roleid = 3 AND ra2.roleid = 5) OR (ra.roleid = 5 AND ra2.roleid = 3)) &lt;br /&gt;
ORDER BY me.useridfrom, me.useridto, me.timecreated&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List of attendees/students that were marked present across courses===&lt;br /&gt;
This report will pull all Present students across a specific category.  &lt;br /&gt;
Contributed by: Emma Richardson&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.firstname AS &amp;quot;First Name&amp;quot;, u.lastname AS &amp;quot;Last Name&amp;quot;, u.Institution AS &amp;quot;District&amp;quot;,c.fullname AS &amp;quot;Training&amp;quot;, DATE_FORMAT(FROM_UNIXTIME(att.sessdate),&#039;%d %M %Y&#039;)AS Date&lt;br /&gt;
&lt;br /&gt;
FROM prefix_attendance_sessions AS att&lt;br /&gt;
JOIN prefix_attendance_log AS attlog ON att.id = attlog.sessionid&lt;br /&gt;
JOIN prefix_attendance_statuses AS attst ON attlog.statusid = attst.id&lt;br /&gt;
JOIN prefix_attendance AS a ON att.attendanceid = a.id&lt;br /&gt;
JOIN prefix_course AS c ON a.course = c.id&lt;br /&gt;
JOIN prefix_user AS u ON attlog.studentid = u.id&lt;br /&gt;
&lt;br /&gt;
WHERE attst.acronym = &amp;quot;P&amp;quot;&lt;br /&gt;
AND c.category = INSERT YOUR CATEGORY ID HERE&lt;br /&gt;
ORDER BY c.fullname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Log Activity Reports==&lt;br /&gt;
===Count all Active Users by ROLE in a course category (including all of its sub-categories)===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT COUNT(DISTINCT l.userid) as active&lt;br /&gt;
FROM mdl_course as c&lt;br /&gt;
JOIN mdl_context AS ctx ON  ctx.instanceid=c.id&lt;br /&gt;
JOIN mdl_role_assignments AS ra ON ra.contextid = ctx.id&lt;br /&gt;
JOIN mdl_user_lastaccess as l ON ra.userid = l.userid&lt;br /&gt;
JOIN mdl_course_categories AS cats ON c.category = cats.id&lt;br /&gt;
WHERE c.category=cats.id AND (&lt;br /&gt;
	cats.path LIKE &#039;%/80/%&#039;&lt;br /&gt;
	OR cats.path LIKE &#039;%/80&#039;&lt;br /&gt;
) &lt;br /&gt;
AND ra.roleid=3  AND ctx.contextlevel=50  #ra.roleid= TEACHER 3, NON-EDITING TEACHER 4, STUDENT 5&lt;br /&gt;
AND  l.timeaccess &amp;gt; (unix_timestamp() - ((60*60*24)*NO_OF_DAYS)) #NO_OF_DAYS change to number&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
===Detailed &amp;quot;VIEW&amp;quot; ACTION for each ROLE (TEACHER,NONE-EDITING TEACHER and STUDENT)===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT l.action, count( l.userid ) as counter , r.name&lt;br /&gt;
FROM `prefix_log` as l&lt;br /&gt;
JOIN `prefix_role_assignments` AS ra on l.userid = ra.userid&lt;br /&gt;
JOIN `prefix_role` AS r ON ra.roleid = r.id&lt;br /&gt;
WHERE (ra.roleid IN (3,4,5)) AND (l.action LIKE &#039;%view%&#039; )&lt;br /&gt;
GROUP BY roleid,l.action&lt;br /&gt;
order by r.name,counter desc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Total Activity of Roles:&amp;quot;Teacher&amp;quot; and &amp;quot;None-Editing Teacher&amp;quot; by Dates and by Hours===&lt;br /&gt;
The output columns of this report table can be used as base for a Pivot-Table&lt;br /&gt;
which will show the amount of &#039;&#039;&#039;activity&#039;&#039;&#039; per &#039;&#039;&#039;hour&#039;&#039;&#039; per &#039;&#039;&#039;days&#039;&#039;&#039; in 3D graph view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT DATE_FORMAT( FROM_UNIXTIME( l.time ) , &#039;%Y-%m-%d&#039; ) AS grptimed ,&lt;br /&gt;
DATE_FORMAT( FROM_UNIXTIME( l.time ) , &#039;%k&#039; ) AS grptimeh  , count( l.userid ) AS counter &lt;br /&gt;
FROM `prefix_log` AS l&lt;br /&gt;
JOIN prefix_user AS u ON u.id = l.userid&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON l.userid = ra.userid&lt;br /&gt;
JOIN prefix_role AS r ON r.id = ra.roleid&lt;br /&gt;
WHERE ra.roleid IN (3,4)&lt;br /&gt;
GROUP BY grptimed,grptimeh&lt;br /&gt;
ORDER BY grptimed,grptimeh&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How many LOGINs per user and user&#039;s Activity===&lt;br /&gt;
+ link username to a user activity graph report&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/user.php?id=1&amp;amp;user=&#039;,u.id,&#039;&amp;amp;mode=alllogs&amp;quot;&amp;gt;&#039;,u.firstname ,&#039; &#039;,u.lastname,&#039;&amp;lt;/a&amp;gt;&#039;) as Username&lt;br /&gt;
,count(*) as logins&lt;br /&gt;
,(SELECT count(*) FROM prefix_log WHERE userid = l.userid GROUP BY userid) as Activity &lt;br /&gt;
FROM prefix_log as l JOIN prefix_user as u ON l.userid = u.id &lt;br /&gt;
WHERE `action` LIKE &#039;%login%&#039; group by userid&lt;br /&gt;
ORDER BY Activity DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
===Distinct user logins per month===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
The following will show you the months of the current calendar year with the total number of distinct, unique user logins per month. Change the year in the WHERE clause to the year you need.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
 COUNT(DISTINCT l.userid) AS &#039;DistinctUserLogins&#039;, &lt;br /&gt;
 DATE_FORMAT(FROM_UNIXTIME(l.timecreated), &#039;%M&#039;) AS &#039;Month&#039;&lt;br /&gt;
FROM prefix_logstore_standard_log l&lt;br /&gt;
WHERE l.action = &#039;loggedin&#039; AND YEAR(FROM_UNIXTIME(l.timecreated)) = &#039;2017&#039; &lt;br /&gt;
GROUP BY MONTH(FROM_UNIXTIME(l.timecreated))&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Total activity per course, per unique user on the last 24h===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
    COUNT(DISTINCT userid) AS countUsers&lt;br /&gt;
  , COUNT(l.courseid) AS countVisits&lt;br /&gt;
  , CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;, c.fullname, &#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
&lt;br /&gt;
FROM mdl_logstore_standard_log AS l&lt;br /&gt;
  JOIN mdl_course AS c ON c.id = l.courseid&lt;br /&gt;
WHERE l.courseid &amp;gt; 0&lt;br /&gt;
      AND FROM_UNIXTIME(l.timecreated) &amp;gt;= DATE_SUB(NOW(), INTERVAL 1 DAY)&lt;br /&gt;
      AND c.fullname LIKE &#039;%תשעו%&#039;&lt;br /&gt;
GROUP BY l.courseid&lt;br /&gt;
ORDER BY countVisits DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Weekly Instructor Online Participation===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College&lt;br /&gt;
&lt;br /&gt;
Displays participation of instructors in all courses per week of a term, including pre-term and post-term edits. An edit is defined as a change to the course, such as a discussion post, the grading of an assignment, or the uploading of file attachments, as well as alterations to course content.&lt;br /&gt;
&lt;br /&gt;
* To specify a subject and/or course number, use % as a wildcard, e.g. ARTS% or ARTS501%&lt;br /&gt;
* To match part of a last name, use %, e.g. Smi% will match &amp;quot;Smith&amp;quot;, &amp;quot;Smile&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
At our institution, we include filters on the course name or category to constrain by terms. These are very specific to how course names and categories are constructed at our institution, so I&#039;ve removed those elements from this code. Also, our terms are 12 weeks long. You would want to insert additional &amp;quot;SUM&amp;quot; lines for longer terms, or remove lines for shorter terms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This report can take a long time to run. While it can be run in Configurable Reports on demand, it may be more appropriate to implement it in the Ad Hoc Queries plugin as a scheduled report.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This version uses legacy (pre-2.7) logs. See below for post-2.7 Standard Logs version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
c.shortname AS CourseID&lt;br /&gt;
, cc.name AS Category&lt;br /&gt;
, CONCAT(u.firstname ,&#039; &#039;,u.lastname) AS Instructor&lt;br /&gt;
&lt;br /&gt;
, (SELECT COUNT( ra2.userid ) AS Users2 FROM prefix_role_assignments AS ra2&lt;br /&gt;
JOIN prefix_context AS ctx2 ON ra2.contextid = ctx2.id&lt;br /&gt;
WHERE ra2.roleid = 5 AND ctx2.instanceid = c.id) AS Students&lt;br /&gt;
&lt;br /&gt;
, c.startdate AS Course_Start_Date&lt;br /&gt;
&lt;br /&gt;
, c.visible AS Visible&lt;br /&gt;
&lt;br /&gt;
,  COUNT(l.id) AS Edits&lt;br /&gt;
&lt;br /&gt;
, SUM(IF(WEEK(FROM_UNIXTIME(l.time)) - WEEK(FROM_UNIXTIME(c.startdate))&amp;lt;0,1,0)) AS BeforeTerm&lt;br /&gt;
&lt;br /&gt;
, SUM(IF(WEEK(FROM_UNIXTIME(l.time))-WEEK(FROM_UNIXTIME(c.startdate))=0,1,0)) AS Week1&lt;br /&gt;
, SUM(IF(WEEK(FROM_UNIXTIME(l.time))-WEEK(FROM_UNIXTIME(c.startdate))=1,1,0)) AS Week2&lt;br /&gt;
, SUM(IF(WEEK(FROM_UNIXTIME(l.time))-WEEK(FROM_UNIXTIME(c.startdate))=2,1,0)) AS Week3&lt;br /&gt;
, SUM(IF(WEEK(FROM_UNIXTIME(l.time))-WEEK(FROM_UNIXTIME(c.startdate))=3,1,0)) AS Week4&lt;br /&gt;
, SUM(IF(WEEK(FROM_UNIXTIME(l.time))-WEEK(FROM_UNIXTIME(c.startdate))=4,1,0)) AS Week5&lt;br /&gt;
, SUM(IF(WEEK(FROM_UNIXTIME(l.time))-WEEK(FROM_UNIXTIME(c.startdate))=5,1,0)) AS Week6&lt;br /&gt;
, SUM(IF(WEEK(FROM_UNIXTIME(l.time))-WEEK(FROM_UNIXTIME(c.startdate))=6,1,0)) AS Week7&lt;br /&gt;
, SUM(IF(WEEK(FROM_UNIXTIME(l.time))-WEEK(FROM_UNIXTIME(c.startdate))=7,1,0)) AS Week8&lt;br /&gt;
, SUM(IF(WEEK(FROM_UNIXTIME(l.time))-WEEK(FROM_UNIXTIME(c.startdate))=8,1,0)) AS Week9&lt;br /&gt;
, SUM(IF(WEEK(FROM_UNIXTIME(l.time))-WEEK(FROM_UNIXTIME(c.startdate))=9,1,0)) AS Week10&lt;br /&gt;
, SUM(IF(WEEK(FROM_UNIXTIME(l.time))-WEEK(FROM_UNIXTIME(c.startdate))=10,1,0)) AS Week11&lt;br /&gt;
, SUM(IF(WEEK(FROM_UNIXTIME(l.time))-WEEK(FROM_UNIXTIME(c.startdate))=11,1,0)) AS Week12&lt;br /&gt;
&lt;br /&gt;
, SUM(IF(WEEK(FROM_UNIXTIME(l.time))-WEEK(FROM_UNIXTIME(c.startdate))&amp;gt;=12,1,0)) AS AfterTerm&lt;br /&gt;
&lt;br /&gt;
, CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/report/log/index.php&#039;,CHAR(63),&#039;chooselog=1&amp;amp;showusers=1&amp;amp;showcourses=0&amp;amp;id=&#039;,c.id,&#039;&amp;amp;user=&#039;,u.id,&#039;&amp;amp;date=0&amp;amp;modid=&amp;amp;modaction=&amp;amp;logformat=showashtml&#039;,&#039;&amp;quot;&amp;gt;&#039;,&#039;Logs&#039;,&#039;&amp;lt;/a&amp;gt;&#039;) AS Link&lt;br /&gt;
&lt;br /&gt;
FROM prefix_user AS u&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_course_categories as cc ON c.category = cc.id&lt;br /&gt;
&lt;br /&gt;
LEFT JOIN prefix_log AS l ON l.userid = u.id AND l.course = c.id  AND l.action NOT LIKE &amp;quot;view%&amp;quot;&lt;br /&gt;
&lt;br /&gt;
WHERE ra.roleid =3&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
AND c.shortname LIKE :course&lt;br /&gt;
AND u.lastname LIKE :last_name&lt;br /&gt;
&lt;br /&gt;
GROUP BY u.idnumber, c.id&lt;br /&gt;
HAVING students &amp;gt; 0&lt;br /&gt;
ORDER BY c.shortname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Post-2.7 log version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
c.shortname AS CourseID&lt;br /&gt;
, cc.name AS Category&lt;br /&gt;
, CONCAT(u.firstname ,&#039; &#039;,u.lastname) AS Instructor&lt;br /&gt;
&lt;br /&gt;
, (SELECT COUNT( ra2.userid ) AS Users2 FROM prefix_role_assignments AS ra2&lt;br /&gt;
JOIN prefix_context AS ctx2 ON ra2.contextid = ctx2.id&lt;br /&gt;
WHERE ra2.roleid = 5 AND ctx2.instanceid = c.id) AS Students&lt;br /&gt;
&lt;br /&gt;
, FROM_UNIXTIME(c.startdate) AS Course_Start_Date&lt;br /&gt;
&lt;br /&gt;
, c.visible AS Visible&lt;br /&gt;
&lt;br /&gt;
,  COUNT(DISTINCT l.id) AS Edits&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF((l.timecreated-c.startdate)&amp;lt;0,l.id,NULL)) AS &#039;Before Term&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=0,l.id,NULL)) AS &#039;Week 1&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=1,l.id,NULL)) AS &#039;Week 2&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=2,l.id,NULL)) AS &#039;Week 3&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=3,l.id,NULL)) AS &#039;Week 4&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=4,l.id,NULL)) AS &#039;Week 5&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=5,l.id,NULL)) AS &#039;Week 6&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=6,l.id,NULL)) AS &#039;Week 7&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=7,l.id,NULL)) AS &#039;Week 8&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=8,l.id,NULL)) AS &#039;Week 9&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=9,l.id,NULL)) AS &#039;Week 10&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=10,l.id,NULL)) AS &#039;Week 11&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=11,l.id,NULL)) AS &#039;Week 12&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))&amp;gt;=12,l.id,NULL)) AS &#039;After Term&#039;&lt;br /&gt;
&lt;br /&gt;
, CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/report/log/index.php&#039;,CHAR(63),&#039;chooselog=1&amp;amp;showusers=1&amp;amp;showcourses=0&amp;amp;id=&#039;,c.id,&#039;&amp;amp;user=&#039;,u.id,&#039;&amp;amp;date=0&amp;amp;modid=&amp;amp;modaction=&amp;amp;logformat=showashtml&#039;,&#039;&amp;quot;&amp;gt;&#039;,&#039;Logs&#039;,&#039;&amp;lt;/a&amp;gt;&#039;) AS Link&lt;br /&gt;
&lt;br /&gt;
FROM prefix_user AS u&lt;br /&gt;
LEFT JOIN prefix_role_assignments AS ra ON u.id = ra.userid&lt;br /&gt;
LEFT JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
LEFT JOIN prefix_course AS c ON c.id = ctx.instanceid&lt;br /&gt;
LEFT JOIN prefix_course_categories as cc ON c.category = cc.id&lt;br /&gt;
&lt;br /&gt;
LEFT JOIN prefix_logstore_standard_log AS l ON l.userid = u.id AND l.courseid = c.id  AND l.crud IN (&#039;c&#039;,&#039;u&#039;)&lt;br /&gt;
&lt;br /&gt;
WHERE ra.roleid =3&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
AND c.shortname LIKE &#039;%OL-%&#039;&lt;br /&gt;
AND cc.idnumber LIKE &#039;%current%&#039;&lt;br /&gt;
&lt;br /&gt;
GROUP BY u.idnumber, c.id&lt;br /&gt;
#HAVING students &amp;gt; 0&lt;br /&gt;
ORDER BY RIGHT(c.shortname,2), c.shortname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Weekly Student Online Participation===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College&lt;br /&gt;
&lt;br /&gt;
Displays participation of students in the current course by week, including pre-term and post-term edits. An edit is defined as a change to the course, such as a discussion post, the submission of an assignment, or the completion of a quiz, as well as alterations to course content such as database entries (if permitted).&lt;br /&gt;
&lt;br /&gt;
Links to three other reports are also provided:&lt;br /&gt;
&lt;br /&gt;
* Logs: complete log entries for the student in the course, organized by date&lt;br /&gt;
* Activity Outline: the &amp;quot;Outline Report&amp;quot; from the User Activity Reports, summarizing the student&#039;s activity in the course, organized by course content&lt;br /&gt;
* Consolidated Activity Report: the &amp;quot;Complete Report&amp;quot; from the User Activity Reports, detailing the student&#039;s activity in the course, organized by course content (includes text of forum posts)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This should be defined as a &amp;quot;Global&amp;quot; report (visible from within all courses). At our institution, our terms are 12 weeks long. You would want to insert additional &amp;quot;SUM&amp;quot; lines for longer terms, or remove lines for shorter terms. We pull advisor names into student user profiles as part of our configuration. These lines are present in the code below, but are commented out, as they are very specific to your Moodle configuration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This version of the report uses legacy (pre-2.7) logs. See below for a post-2.7 Standard Logs version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
u.lastname AS &#039;Last Name&#039;&lt;br /&gt;
, u.firstname AS &#039;First Name&#039;&lt;br /&gt;
,  COUNT(l.id) AS &#039;Edits&#039;&lt;br /&gt;
&lt;br /&gt;
, SUM(IF((l.time-c.startdate)/7&amp;lt;0,1,0)) AS &#039;Before Term&#039;&lt;br /&gt;
&lt;br /&gt;
, SUM(IF(FLOOR((l.time - c.startdate)/(60*60*24*7))=0,1,0)) AS &#039;Week 1&#039;&lt;br /&gt;
, SUM(IF(FLOOR((l.time - c.startdate)/(60*60*24*7))=1,1,0)) AS &#039;Week 2&#039;&lt;br /&gt;
, SUM(IF(FLOOR((l.time - c.startdate)/(60*60*24*7))=2,1,0)) AS &#039;Week 3&#039;&lt;br /&gt;
, SUM(IF(FLOOR((l.time - c.startdate)/(60*60*24*7))=3,1,0)) AS &#039;Week 4&#039;&lt;br /&gt;
, SUM(IF(FLOOR((l.time - c.startdate)/(60*60*24*7))=4,1,0)) AS &#039;Week 5&#039;&lt;br /&gt;
, SUM(IF(FLOOR((l.time - c.startdate)/(60*60*24*7))=5,1,0)) AS &#039;Week 6&#039;&lt;br /&gt;
, SUM(IF(FLOOR((l.time - c.startdate)/(60*60*24*7))=6,1,0)) AS &#039;Week 7&#039;&lt;br /&gt;
, SUM(IF(FLOOR((l.time - c.startdate)/(60*60*24*7))=7,1,0)) AS &#039;Week 8&#039;&lt;br /&gt;
, SUM(IF(FLOOR((l.time - c.startdate)/(60*60*24*7))=8,1,0)) AS &#039;Week 9&#039;&lt;br /&gt;
, SUM(IF(FLOOR((l.time - c.startdate)/(60*60*24*7))=9,1,0)) AS &#039;Week 10&#039;&lt;br /&gt;
, SUM(IF(FLOOR((l.time - c.startdate)/(60*60*24*7))=10,1,0)) AS &#039;Week 11&#039;&lt;br /&gt;
, SUM(IF(FLOOR((l.time - c.startdate)/(60*60*24*7))=11,1,0)) AS &#039;Week 12&#039;&lt;br /&gt;
&lt;br /&gt;
, SUM(IF(FLOOR((l.time - c.startdate)/(60*60*24*7))&amp;gt;=15,1,0)) AS &#039;After Term&#039;&lt;br /&gt;
&lt;br /&gt;
, CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/report/log/index.php&#039;,CHAR(63),&#039;chooselog=1&amp;amp;showusers=1&amp;amp;showcourses=0&amp;amp;id=&#039;,c.id,&#039;&amp;amp;user=&#039;,u.id,&#039;&amp;amp;date=0&amp;amp;modid=&amp;amp;modaction=&amp;amp;logformat=showashtml&#039;,&#039;&amp;quot;&amp;gt;&#039;,&#039;Logs&#039;,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Logs&#039;&lt;br /&gt;
&lt;br /&gt;
, CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/report/outline/user.php&#039;,CHAR(63),&#039;id=&#039;,u.id,&#039;&amp;amp;course=&#039;,c.id,&#039;&amp;amp;mode=outline&amp;quot;&amp;gt;&#039;,&#039;Outline&#039;,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Activity Outline&#039;&lt;br /&gt;
&lt;br /&gt;
, CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/report/outline/user.php&#039;,CHAR(63),&#039;id=&#039;,u.id,&#039;&amp;amp;course=&#039;,c.id,&#039;&amp;amp;mode=complete&amp;quot;&amp;gt;&#039;,&#039;Activity&#039;,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Consolidated Activity&#039;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_user AS u&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_course_categories as cc ON c.category = cc.id&lt;br /&gt;
&lt;br /&gt;
LEFT JOIN prefix_log AS l ON l.userid = u.id AND l.course = c.id  AND l.action NOT LIKE &amp;quot;view%&amp;quot;&lt;br /&gt;
&lt;br /&gt;
WHERE ra.roleid =5&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
&lt;br /&gt;
AND c.id = %%COURSEID%%&lt;br /&gt;
&lt;br /&gt;
GROUP BY u.idnumber&lt;br /&gt;
&lt;br /&gt;
ORDER BY u.lastname, u.firstname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Post-2.7 (Standard Logs) version&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
u.lastname AS &#039;Last Name&#039;&lt;br /&gt;
, u.firstname AS &#039;First Name&#039;&lt;br /&gt;
,  COUNT(l.id) AS &#039;Edits&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF((l.timecreated-c.startdate)&amp;lt;0,l.id,NULL)) AS &#039;Before Term&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=0,l.id,NULL)) AS &#039;Week 1&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=1,l.id,NULL)) AS &#039;Week 2&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=2,l.id,NULL)) AS &#039;Week 3&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=3,l.id,NULL)) AS &#039;Week 4&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=4,l.id,NULL)) AS &#039;Week 5&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=5,l.id,NULL)) AS &#039;Week 6&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=6,l.id,NULL)) AS &#039;Week 7&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=7,l.id,NULL)) AS &#039;Week 8&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=8,l.id,NULL)) AS &#039;Week 9&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=9,l.id,NULL)) AS &#039;Week 10&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=10,l.id,NULL)) AS &#039;Week 11&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=11,l.id,NULL)) AS &#039;Week 12&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))&amp;gt;=12,l.id,NULL)) AS &#039;After Term&#039;&lt;br /&gt;
&lt;br /&gt;
# Our institution stores academic advisor names and emails in custom profile fields&lt;br /&gt;
#, CONCAT(&#039;&amp;lt;a href=&amp;quot;mailto:&#039;,uce.data,&#039;&amp;quot;&amp;gt;&#039;,uid.data, &#039;&amp;lt;/a&amp;gt;&#039;)  AS &#039;Academic Advisor&#039;&lt;br /&gt;
&lt;br /&gt;
, CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/report/log/index.php&#039;,CHAR(63),&#039;chooselog=1&amp;amp;showusers=1&amp;amp;showcourses=0&amp;amp;id=&#039;,c.id,&#039;&amp;amp;user=&#039;,u.id,&#039;&amp;amp;date=0&amp;amp;modid=&amp;amp;modaction=&amp;amp;logformat=showashtml&#039;,&#039;&amp;quot;&amp;gt;&#039;,&#039;Logs&#039;,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Logs&#039;&lt;br /&gt;
&lt;br /&gt;
, CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/report/outline/user.php&#039;,CHAR(63),&#039;id=&#039;,u.id,&#039;&amp;amp;course=&#039;,c.id,&#039;&amp;amp;mode=outline&amp;quot;&amp;gt;&#039;,&#039;Outline&#039;,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Activity Outline&#039;&lt;br /&gt;
&lt;br /&gt;
, CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/report/outline/user.php&#039;,CHAR(63),&#039;id=&#039;,u.id,&#039;&amp;amp;course=&#039;,c.id,&#039;&amp;amp;mode=complete&amp;quot;&amp;gt;&#039;,&#039;Activity&#039;,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Consolidated Activity&#039;&lt;br /&gt;
&lt;br /&gt;
, CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/forum/user.php&#039;,CHAR(63),&#039;id=&#039;,u.id,&#039;&amp;amp;course=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,&#039;Posts&#039;,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Posts&#039;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_user AS u&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_course_categories as cc ON c.category = cc.id&lt;br /&gt;
&lt;br /&gt;
# student academic coach - you can include custom profile field data with these methods&lt;br /&gt;
# LEFT JOIN prefix_user_info_data as uid ON u.id = uid.userid AND uid.fieldid = &#039;2&#039;&lt;br /&gt;
# student academic coach email&lt;br /&gt;
# LEFT JOIN prefix_user_info_data as uce on u.id = uce.userid AND uce.fieldid = &#039;6&#039;&lt;br /&gt;
&lt;br /&gt;
LEFT JOIN prefix_logstore_standard_log AS l ON l.userid = u.id AND l.courseid = c.id  AND l.crud IN (&#039;c&#039;,&#039;u&#039;)&lt;br /&gt;
&lt;br /&gt;
WHERE ra.roleid =5&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
&lt;br /&gt;
AND c.id = %%COURSEID%%&lt;br /&gt;
&lt;br /&gt;
GROUP BY u.idnumber&lt;br /&gt;
&lt;br /&gt;
ORDER BY u.lastname, u.firstname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===My Weekly Online Participation===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College&lt;br /&gt;
&lt;br /&gt;
Displays participation of the &#039;&#039;&#039;current user&#039;&#039;&#039; in the &#039;&#039;&#039;current course&#039;&#039;&#039; by week, including pre-term and post-term submissions/edits. A submission/edit is defined as a change to the course, such as a discussion post, the submission of an assignment, or the completion of a quiz, as well as alterations to course content such as database entries or new course activities or resources (if permitted).&lt;br /&gt;
&lt;br /&gt;
This report uses Standard Logs (post 2.7).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
&lt;br /&gt;
l.component AS &#039;activity&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF((l.timecreated-c.startdate)&amp;lt;0,l.id,NULL)) AS &#039;Before Term&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=0,l.id,NULL)) AS &#039;Week 1&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=1,l.id,NULL)) AS &#039;Week 2&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=2,l.id,NULL)) AS &#039;Week 3&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=3,l.id,NULL)) AS &#039;Week 4&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=4,l.id,NULL)) AS &#039;Week 5&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=5,l.id,NULL)) AS &#039;Week 6&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=6,l.id,NULL)) AS &#039;Week 7&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=7,l.id,NULL)) AS &#039;Week 8&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=8,l.id,NULL)) AS &#039;Week 9&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=9,l.id,NULL)) AS &#039;Week 10&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=10,l.id,NULL)) AS &#039;Week 11&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))=11,l.id,NULL)) AS &#039;Week 12&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF(FLOOR((l.timecreated - c.startdate)/(60*60*24*7))&amp;gt;=12,l.id,NULL)) AS &#039;After Term&#039;&lt;br /&gt;
&lt;br /&gt;
,  COUNT(l.id) AS &#039;Total&#039;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_user AS u&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_course_categories as cc ON c.category = cc.id&lt;br /&gt;
&lt;br /&gt;
LEFT JOIN prefix_logstore_standard_log AS l ON l.userid = u.id AND l.courseid = c.id  AND l.crud IN (&#039;c&#039;,&#039;u&#039;)&lt;br /&gt;
&lt;br /&gt;
WHERE 1&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
&lt;br /&gt;
AND c.id = %%COURSEID%%&lt;br /&gt;
AND u.id = %%USERID%%&lt;br /&gt;
&lt;br /&gt;
GROUP BY l.component&lt;br /&gt;
&lt;br /&gt;
ORDER BY l.component&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Faculty/Student Interactions===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College&lt;br /&gt;
&lt;br /&gt;
Returns a count of instructor and other-student responses to student activity for the specified time period. This report can help indicate whether students&#039; comments are being responded to, as well as summarizing post activity by students during the specified time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This version of the report uses legacy (pre-2.7) logs. See below for the post-2.7 Standard Logs version.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This should be defined as a &amp;quot;Global&amp;quot; report (visible from within all courses). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This report can take a long time to run. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
&lt;br /&gt;
# Identify student&lt;br /&gt;
CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/message/index.php?id=&#039; , allstu.id , &#039;&amp;quot;&amp;gt;&#039; , allstu.firstname , &#039; &#039; , allstu.lastname , &#039;&amp;lt;/a&amp;gt;&#039; ) AS &#039;Student - click to send message&#039;&lt;br /&gt;
&lt;br /&gt;
, IF((COUNT(DISTINCT IF(fps.created &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),fps.id,NULL) )&amp;gt;0) OR (COUNT(DISTINCT IF(asb.timemodified &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),asb.id,NULL))&amp;gt;0) OR  (SELECT COUNT(DISTINCT mfs.id) FROM prefix_message AS mfs WHERE mfs.useridfrom = allstu.id AND mfs.useridto = instr.id AND mfs.timecreated &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60))),&#039;YES&#039;,&#039;NO&#039;) AS &#039;Student Participated This week&#039;&lt;br /&gt;
&lt;br /&gt;
, IF((COUNT(DISTINCT IF(fpi.created &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),fpi.id,NULL) )&amp;gt;0) OR (COUNT(DISTINCT IF(asg.timemodified &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),asg.id,NULL))&amp;gt;0) OR (SELECT COUNT(DISTINCT mts.id) FROM prefix_message AS mts WHERE mts.useridfrom = instr.id AND mts.useridto = allstu.id  AND mts.timecreated &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60))),&#039;YES&#039;,&#039;NO&#039;) AS &#039;Student Contacted This week&#039;&lt;br /&gt;
&lt;br /&gt;
## Only posts within last 7 days&lt;br /&gt;
&lt;br /&gt;
# Count posts by student&lt;br /&gt;
, COUNT(DISTINCT IF(fps.created &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),fps.id,NULL)) AS &#039;Forum Stu Posts - 7 days&#039;&lt;br /&gt;
&lt;br /&gt;
# Count replies to student posts by instructors&lt;br /&gt;
, COUNT(DISTINCT IF(fpi.created &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),fpi.id,NULL) ) AS &#039;Forum Instr Replies - 7 days&#039;&lt;br /&gt;
&lt;br /&gt;
# using link back to student posts on replies, get unique student IDs responded&lt;br /&gt;
, COUNT(DISTINCT IF(fpsr.created &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),fpsr.id,NULL)) - COUNT(DISTINCT IF(fpi.created &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),fpi.id,NULL) ) AS &#039;Forum Stu Replies - 7 days&#039;&lt;br /&gt;
&lt;br /&gt;
# all replies&lt;br /&gt;
, COUNT(DISTINCT IF(fpsr.created &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),fpsr.id,NULL)) AS &#039;Forum All Replies - 7 days&#039;&lt;br /&gt;
&lt;br /&gt;
# add in count of graded assignments - 7 days&lt;br /&gt;
, COUNT(DISTINCT IF(asb.timemodified &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),asb.id,NULL)) AS &#039;Assign Submit - 7 days&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(asg.timemodified &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),asg.id,NULL)) AS &#039;Assign Grades - 7 days&#039;&lt;br /&gt;
&lt;br /&gt;
# Messages between students and instructors - 7 days&lt;br /&gt;
,  (SELECT COUNT(DISTINCT mfs.id) FROM prefix_message AS mfs WHERE mfs.useridfrom = allstu.id AND mfs.useridto = instr.id AND mfs.timecreated &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60))) AS &#039;Msg Stu to Instr - 7 days&#039;&lt;br /&gt;
, (SELECT COUNT(DISTINCT mts.id) FROM prefix_message AS mts WHERE mts.useridfrom = instr.id AND mts.useridto = allstu.id  AND mts.timecreated &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60))) AS &#039;Msg Instr to Stu - 7 days&#039;&lt;br /&gt;
&lt;br /&gt;
## All posts in course so far&lt;br /&gt;
# Count posts by student&lt;br /&gt;
, COUNT(DISTINCT fps.id) AS &#039;Forum Stu Posts - to date&#039;&lt;br /&gt;
&lt;br /&gt;
# Count replies to student posts by instructors&lt;br /&gt;
, COUNT(DISTINCT fpi.id) AS &#039;Forum Instr Replies - to date&#039;&lt;br /&gt;
&lt;br /&gt;
# using link back to student posts on replies, get unique student IDs responded&lt;br /&gt;
, COUNT(DISTINCT fpsr.id) - COUNT(DISTINCT fpi.id) AS &#039;Forum Stu Replies - to date&#039;&lt;br /&gt;
&lt;br /&gt;
# all replies&lt;br /&gt;
, COUNT(DISTINCT fpsr.id) AS &#039;Forum All Replies - to date&#039;&lt;br /&gt;
&lt;br /&gt;
# add in count of graded assignments - whole course&lt;br /&gt;
, COUNT(DISTINCT asb.id) AS &#039;Assign Submit - to date&#039;&lt;br /&gt;
, COUNT(DISTINCT asg.id) AS &#039;Assign Grades - to date&#039;&lt;br /&gt;
&lt;br /&gt;
# Messages between students and instructors - to date&lt;br /&gt;
,  (SELECT COUNT(DISTINCT mfs.id) FROM prefix_message AS mfs WHERE mfs.useridfrom = allstu.id AND mfs.useridto = instr.id ) AS &#039;Msg Stu to Instr - to date&#039;&lt;br /&gt;
, (SELECT COUNT(DISTINCT mts.id) FROM prefix_message AS mts WHERE mts.useridfrom = instr.id AND mts.useridto = allstu.id) AS &#039;Msg Instr to Stu - to date&#039;&lt;br /&gt;
&lt;br /&gt;
## JOINS&lt;br /&gt;
&lt;br /&gt;
# Start by getting all the students in the course&lt;br /&gt;
FROM prefix_user AS allstu &lt;br /&gt;
JOIN prefix_role_assignments AS ras ON allstu.id = ras.userid AND ras.roleid = 5&lt;br /&gt;
JOIN prefix_context AS ctx  ON ras.contextid = ctx.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_course_categories as cc ON c.category = cc.id&lt;br /&gt;
&lt;br /&gt;
# Now we get the forums and forum discussions from this course only&lt;br /&gt;
LEFT JOIN prefix_forum AS frm ON frm.course = c.id AND c.id = %%COURSEID%%&lt;br /&gt;
LEFT JOIN prefix_forum_discussions AS fd ON fd.course = %%COURSEID%% AND fd.forum = frm.id&lt;br /&gt;
&lt;br /&gt;
# These are forum discussion posts just by students within specified time&lt;br /&gt;
LEFT JOIN prefix_forum_posts AS fps ON fps.userid = allstu.id AND fps.discussion = fd.id&lt;br /&gt;
&lt;br /&gt;
# Separately, we connect the instructors of the courses&lt;br /&gt;
# We can use the context we have already gotten for the students&lt;br /&gt;
LEFT JOIN prefix_role_assignments AS rai ON rai.contextid = ctx.id&lt;br /&gt;
LEFT JOIN prefix_user AS instr ON instr.id = rai.userid AND rai.roleid =3&lt;br /&gt;
&lt;br /&gt;
# Now we will connect to posts by instructors that are replies to student posts&lt;br /&gt;
# This is a left join, because we don&#039;t want to eliminate any students from the list&lt;br /&gt;
LEFT JOIN prefix_forum_posts AS fpi ON fpi.discussion = fd.id AND fpi.userid = instr.id AND fpi.parent = fps.id&lt;br /&gt;
&lt;br /&gt;
# To get identities of only those students who were replied to:&lt;br /&gt;
# Connect from instr replies back up to parent posts by students again&lt;br /&gt;
# This has to be a LEFT JOIN, we know these posts exist but don&#039;t eliminate non-responded students&lt;br /&gt;
LEFT JOIN prefix_forum_posts AS fpir ON fpir.id = fpi.parent&lt;br /&gt;
&lt;br /&gt;
# We also want to know if students are replying to one another&lt;br /&gt;
# These are posts that are replies to student posts&lt;br /&gt;
# Again, a left join&lt;br /&gt;
LEFT JOIN prefix_forum_posts AS fpsr ON fpsr.discussion = fd.id AND fpsr.parent = fps.id&lt;br /&gt;
&lt;br /&gt;
# get the activity modules&lt;br /&gt;
LEFT JOIN prefix_course_modules AS cm ON c.id = cm.course&lt;br /&gt;
&lt;br /&gt;
# get the assignments&lt;br /&gt;
LEFT JOIN prefix_assign AS a ON  cm.instance = a.id&lt;br /&gt;
 LEFT JOIN prefix_assign_submission AS asb ON a.id = asb.assignment AND asb.userid=allstu.id &lt;br /&gt;
LEFT JOIN prefix_assign_grades AS asg ON asg.assignment = a.id AND asg.userid = allstu.id AND asg.assignment = asb.assignment &lt;br /&gt;
&lt;br /&gt;
# We care about messages that involve both the instructor and students of this course&lt;br /&gt;
# messages from instructor to students:&lt;br /&gt;
# LEFT JOIN prefix_message AS mts ON mts.useridfrom = instr.id AND mts.useridto = allstu.id&lt;br /&gt;
# LEFT JOIN prefix_message AS mfs ON mfs.useridfrom = instr.id AND mfs.useridto = allstu.id&lt;br /&gt;
&lt;br /&gt;
WHERE  &lt;br /&gt;
c.id = %%COURSEID%% &lt;br /&gt;
&lt;br /&gt;
# GROUP BY c.shortname , allstu.id&lt;br /&gt;
GROUP BY allstu.id&lt;br /&gt;
&lt;br /&gt;
ORDER BY allstu.lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Post-2.7 Standard Logs version&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
&lt;br /&gt;
# Identify student&lt;br /&gt;
CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/message/index.php?id=&#039; , allstu.id , &#039;&amp;quot;&amp;gt;&#039; , allstu.firstname , &#039; &#039; , allstu.lastname , &#039;&amp;lt;/a&amp;gt;&#039; ) AS &#039;Student - click to send message&#039;&lt;br /&gt;
&lt;br /&gt;
, IF((COUNT(DISTINCT IF(fps.created &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),fps.id,NULL) )&amp;gt;0) OR (COUNT(DISTINCT IF(asb.timemodified &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),asb.id,NULL))&amp;gt;0) OR  (SELECT COUNT(DISTINCT mfs.id) FROM prefix_message AS mfs WHERE mfs.useridfrom = allstu.id AND mfs.useridto = instr.id AND mfs.timecreated &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60))),&#039;YES&#039;,&#039;NO&#039;) AS &#039;Student Participated This week&#039;&lt;br /&gt;
&lt;br /&gt;
, IF((COUNT(DISTINCT IF(fpi.created &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),fpi.id,NULL) )&amp;gt;0) OR (COUNT(DISTINCT IF(asg.timemodified &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),asg.id,NULL))&amp;gt;0) OR (SELECT COUNT(DISTINCT mts.id) FROM prefix_message AS mts WHERE mts.useridfrom = instr.id AND mts.useridto = allstu.id  AND mts.timecreated &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60))),&#039;YES&#039;,&#039;NO&#039;) AS &#039;Student Contacted This week&#039;&lt;br /&gt;
&lt;br /&gt;
## Only posts within last 7 days&lt;br /&gt;
&lt;br /&gt;
# Count posts by student&lt;br /&gt;
, COUNT(DISTINCT IF(fps.created &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),fps.id,NULL)) AS &#039;Forum Stu Posts - 7 days&#039;&lt;br /&gt;
&lt;br /&gt;
# Count replies to student posts by instructors&lt;br /&gt;
, COUNT(DISTINCT IF(fpi.created &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),fpi.id,NULL) ) AS &#039;Forum Instr Replies - 7 days&#039;&lt;br /&gt;
&lt;br /&gt;
# using link back to student posts on replies, get unique student IDs responded&lt;br /&gt;
, COUNT(DISTINCT IF(fpsr.created &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),fpsr.id,NULL)) - COUNT(DISTINCT IF(fpi.created &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),fpi.id,NULL) ) AS &#039;Forum Stu Replies - 7 days&#039;&lt;br /&gt;
&lt;br /&gt;
# all replies&lt;br /&gt;
, COUNT(DISTINCT IF(fpsr.created &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),fpsr.id,NULL)) AS &#039;Forum All Replies - 7 days&#039;&lt;br /&gt;
&lt;br /&gt;
# add in count of graded assignments - 7 days&lt;br /&gt;
, COUNT(DISTINCT IF(asb.timemodified &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),asb.id,NULL)) AS &#039;Assign Submit - 7 days&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(asg.timemodified &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60)),asg.id,NULL)) AS &#039;Assign Grades - 7 days&#039;&lt;br /&gt;
&lt;br /&gt;
# Messages between students and instructors - 7 days&lt;br /&gt;
,  (SELECT COUNT(DISTINCT mfs.id) FROM prefix_message AS mfs WHERE mfs.useridfrom = allstu.id AND mfs.useridto = instr.id AND mfs.timecreated &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60))) AS &#039;Msg Stu to Instr - 7 days&#039;&lt;br /&gt;
, (SELECT COUNT(DISTINCT mts.id) FROM prefix_message AS mts WHERE mts.useridfrom = instr.id AND mts.useridto = allstu.id  AND mts.timecreated &amp;gt; (UNIX_TIMESTAMP()  - (7*24*60*60))) AS &#039;Msg Instr to Stu - 7 days&#039;&lt;br /&gt;
&lt;br /&gt;
## All posts in course so far&lt;br /&gt;
# Count posts by student&lt;br /&gt;
, COUNT(DISTINCT fps.id) AS &#039;Forum Stu Posts - to date&#039;&lt;br /&gt;
&lt;br /&gt;
# Count replies to student posts by instructors&lt;br /&gt;
, COUNT(DISTINCT fpi.id) AS &#039;Forum Instr Replies - to date&#039;&lt;br /&gt;
&lt;br /&gt;
# using link back to student posts on replies, get unique student IDs responded&lt;br /&gt;
, COUNT(DISTINCT fpsr.id) - COUNT(DISTINCT fpi.id) AS &#039;Forum Stu Replies - to date&#039;&lt;br /&gt;
&lt;br /&gt;
# all replies&lt;br /&gt;
, COUNT(DISTINCT fpsr.id) AS &#039;Forum All Replies - to date&#039;&lt;br /&gt;
&lt;br /&gt;
# add in count of graded assignments - whole course&lt;br /&gt;
, COUNT(DISTINCT asb.id) AS &#039;Assign Submit - to date&#039;&lt;br /&gt;
, COUNT(DISTINCT asg.id) AS &#039;Assign Grades - to date&#039;&lt;br /&gt;
&lt;br /&gt;
# Messages between students and instructors - to date&lt;br /&gt;
,  (SELECT COUNT(DISTINCT mfs.id) FROM prefix_message AS mfs WHERE mfs.useridfrom = allstu.id AND mfs.useridto = instr.id ) AS &#039;Msg Stu to Instr - to date&#039;&lt;br /&gt;
, (SELECT COUNT(DISTINCT mts.id) FROM prefix_message AS mts WHERE mts.useridfrom = instr.id AND mts.useridto = allstu.id) AS &#039;Msg Instr to Stu - to date&#039;&lt;br /&gt;
&lt;br /&gt;
## JOINS&lt;br /&gt;
&lt;br /&gt;
# Start by getting all the students in the course&lt;br /&gt;
FROM prefix_user AS allstu &lt;br /&gt;
JOIN prefix_role_assignments AS ras ON allstu.id = ras.userid AND ras.roleid = 5&lt;br /&gt;
JOIN prefix_context AS ctx  ON ras.contextid = ctx.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_course_categories as cc ON c.category = cc.id&lt;br /&gt;
&lt;br /&gt;
# Now we get the forums and forum discussions from this course only&lt;br /&gt;
JOIN prefix_forum AS frm ON frm.course = c.id AND c.id = %%COURSEID%%&lt;br /&gt;
JOIN prefix_forum_discussions AS fd ON fd.course = %%COURSEID%% AND fd.forum = frm.id&lt;br /&gt;
&lt;br /&gt;
# These are forum discussion posts just by students within specified time&lt;br /&gt;
LEFT JOIN prefix_forum_posts AS fps ON fps.userid = allstu.id AND fps.discussion = fd.id&lt;br /&gt;
&lt;br /&gt;
# Separately, we connect the instructors of the courses&lt;br /&gt;
# We can use the context we have already gotten for the students&lt;br /&gt;
JOIN prefix_role_assignments AS rai ON rai.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS instr ON instr.id = rai.userid AND rai.roleid =3&lt;br /&gt;
&lt;br /&gt;
# Now we will connect to posts by instructors that are replies to student posts&lt;br /&gt;
# This is a left join, because we don&#039;t want to eliminate any students from the list&lt;br /&gt;
LEFT JOIN prefix_forum_posts AS fpi ON fpi.discussion = fd.id AND fpi.userid = instr.id AND fpi.parent = fps.id&lt;br /&gt;
&lt;br /&gt;
# To get identities of only those students who were replied to:&lt;br /&gt;
# Connect from instr replies back up to parent posts by students again&lt;br /&gt;
# This has to be a LEFT JOIN, we know these posts exist but don&#039;t eliminate non-responded students&lt;br /&gt;
LEFT JOIN prefix_forum_posts AS fpir ON fpir.id = fpi.parent&lt;br /&gt;
&lt;br /&gt;
# We also want to know if students are replying to one another&lt;br /&gt;
# These are posts that are replies to student posts&lt;br /&gt;
# Again, a left join&lt;br /&gt;
LEFT JOIN prefix_forum_posts AS fpsr ON fpsr.discussion = fd.id AND fpsr.parent = fps.id&lt;br /&gt;
&lt;br /&gt;
# get the activity modules&lt;br /&gt;
JOIN prefix_course_modules AS cm ON c.id = cm.course&lt;br /&gt;
&lt;br /&gt;
# get the assignments&lt;br /&gt;
 JOIN prefix_assign AS a ON  cm.instance = a.id&lt;br /&gt;
 LEFT JOIN prefix_assign_submission AS asb ON a.id = asb.assignment AND asb.userid=allstu.id &lt;br /&gt;
LEFT JOIN prefix_assign_grades AS asg ON asg.assignment = a.id AND asg.userid = allstu.id AND asg.assignment = asb.assignment &lt;br /&gt;
&lt;br /&gt;
WHERE  &lt;br /&gt;
c.id = %%COURSEID%% &lt;br /&gt;
&lt;br /&gt;
# GROUP BY c.shortname , allstu.id&lt;br /&gt;
GROUP BY allstu.id&lt;br /&gt;
&lt;br /&gt;
ORDER BY allstu.lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Student Resource Usage===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College&lt;br /&gt;
&lt;br /&gt;
Displays usage by students of all activities and resources in the current course by activity. Only activities and sections which are visible in the course are included. This version requires the new &amp;quot;Standard Logs&amp;quot; from Moodle 2.7+.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This should be defined as a &amp;quot;Global&amp;quot; report (visible from within all courses). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
cs.section AS &#039;Week&#039;&lt;br /&gt;
, cs.name AS &#039;Section Name&#039;&lt;br /&gt;
, m.name AS &#039;item type&#039;&lt;br /&gt;
&lt;br /&gt;
, CONCAT(&lt;br /&gt;
COALESCE(a.name, &#039;&#039;), &lt;br /&gt;
COALESCE(b.name,&#039;&#039;), &lt;br /&gt;
COALESCE(cert.name,&#039;&#039;), &lt;br /&gt;
COALESCE(chat.name,&#039;&#039;), &lt;br /&gt;
COALESCE(choice.name,&#039;&#039;), &lt;br /&gt;
COALESCE(data.name,&#039;&#039;), &lt;br /&gt;
COALESCE(feedback.name,&#039;&#039;), &lt;br /&gt;
COALESCE(folder.name,&#039;&#039;), &lt;br /&gt;
COALESCE(forum.name,&#039;&#039;), &lt;br /&gt;
COALESCE(glossary.name,&#039;&#039;), &lt;br /&gt;
COALESCE(imscp.name,&#039;&#039;), &lt;br /&gt;
COALESCE(lesson.name,&#039;&#039;), &lt;br /&gt;
COALESCE(p.name,&#039;&#039;),&lt;br /&gt;
COALESCE(questionnaire.name,&#039;&#039;), &lt;br /&gt;
COALESCE(quiz.name,&#039;&#039;), &lt;br /&gt;
COALESCE(cr.name,&#039;&#039;), &lt;br /&gt;
COALESCE(scorm.name,&#039;&#039;), &lt;br /&gt;
COALESCE(survey.name,&#039;&#039;), &lt;br /&gt;
COALESCE(url.name,&#039;&#039;), &lt;br /&gt;
COALESCE(wiki.name,&#039;&#039;), &lt;br /&gt;
COALESCE(workshop.name,&#039;&#039;), &lt;br /&gt;
COALESCE(kalvidassign.name,&#039;&#039;), &lt;br /&gt;
COALESCE(attendance.name,&#039;&#039;), &lt;br /&gt;
COALESCE(checklist.name,&#039;&#039;), &lt;br /&gt;
COALESCE(flashcard.name,&#039;&#039;), &lt;br /&gt;
COALESCE(lti.name,&#039;&#039;), &lt;br /&gt;
COALESCE(oublog.name,&#039;&#039;), &lt;br /&gt;
COALESCE(ouwiki.name,&#039;&#039;), &lt;br /&gt;
COALESCE(subpage.name,&#039;&#039;), &lt;br /&gt;
COALESCE(journal.name,&#039;&#039;), &lt;br /&gt;
COALESCE(lightboxgallery.name,&#039;&#039;), &lt;br /&gt;
COALESCE(elluminate.name,&#039;&#039;), &lt;br /&gt;
COALESCE(adaptivequiz.name,&#039;&#039;), &lt;br /&gt;
COALESCE(hotpot.name,&#039;&#039;), &lt;br /&gt;
COALESCE(wiziq.name,&#039;&#039;), &lt;br /&gt;
COALESCE(turnitintooltwo.name,&#039;&#039;), &lt;br /&gt;
COALESCE(kvr.name,&#039;&#039;)&lt;br /&gt;
) AS &#039;item name&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
, SUM(IF(l.crud IN (&#039;r&#039;),1,0)) AS &#039;total views&#039;&lt;br /&gt;
, SUM(IF(l.crud IN (&#039;c&#039;,&#039;u&#039;),1,0)) AS &#039;total submissions&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(l.crud IN (&#039;r&#039;),u.id,NULL)) AS &#039;count of students who viewed&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(l.crud IN (&#039;c&#039;,&#039;u&#039;),u.id,NULL)) AS &#039;count of students who submitted&#039;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_user AS u&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_course_categories as cc ON c.category = cc.id&lt;br /&gt;
&lt;br /&gt;
JOIN prefix_course_sections AS cs ON cs.course = c.id AND cs.section &amp;lt;= 14 #AND cs.section &amp;gt; 0&lt;br /&gt;
LEFT JOIN prefix_course_modules AS cm ON cm.course = c.id AND cm.section = cs.id&lt;br /&gt;
JOIN prefix_modules AS m ON m.id = cm.module AND m.name NOT LIKE &#039;label&#039;&lt;br /&gt;
&lt;br /&gt;
LEFT JOIN prefix_assign AS a ON a.id = cm.instance AND m.name = &#039;assign&#039;&lt;br /&gt;
LEFT JOIN prefix_book AS b ON b.id = cm.instance AND m.name = &#039;book&#039;&lt;br /&gt;
LEFT JOIN prefix_certificate AS cert ON cert.id = cm.instance AND m.name = &#039;certificate&#039;&lt;br /&gt;
LEFT JOIN prefix_chat AS chat ON chat.id = cm.instance AND m.name = &#039;chat&#039;&lt;br /&gt;
LEFT JOIN prefix_choice AS choice ON choice.id = cm.instance AND m.name = &#039;choice&#039;&lt;br /&gt;
LEFT JOIN prefix_data AS data ON data.id = cm.instance AND m.name = &#039;data&#039;&lt;br /&gt;
LEFT JOIN prefix_feedback AS feedback ON feedback.id = cm.instance AND m.name = &#039;feedback&#039;&lt;br /&gt;
LEFT JOIN prefix_folder AS folder ON folder.id = cm.instance AND m.name = &#039;folder&#039;&lt;br /&gt;
LEFT JOIN prefix_forum AS forum ON forum.id = cm.instance AND m.name = &#039;forum&#039;&lt;br /&gt;
LEFT JOIN prefix_glossary AS glossary ON glossary.id = cm.instance AND m.name = &#039;glossary&#039;&lt;br /&gt;
LEFT JOIN prefix_imscp AS imscp ON imscp.id = cm.instance AND m.name = &#039;imscp&#039;&lt;br /&gt;
LEFT JOIN prefix_lesson AS lesson ON lesson.id = cm.instance AND m.name = &#039;lesson&#039;&lt;br /&gt;
LEFT JOIN prefix_page AS p ON p.id = cm.instance AND m.name = &#039;page&#039;&lt;br /&gt;
LEFT JOIN prefix_questionnaire AS questionnaire ON questionnaire.id = cm.instance AND m.name = &#039;questionnaire&#039;&lt;br /&gt;
LEFT JOIN prefix_quiz AS quiz ON quiz.id = cm.instance AND m.name = &#039;quiz&#039;&lt;br /&gt;
LEFT JOIN prefix_resource AS cr ON cr.id = cm.instance AND m.name = &#039;resource&#039;&lt;br /&gt;
LEFT JOIN prefix_scorm AS scorm ON scorm.id = cm.instance AND m.name = &#039;scorm&#039;&lt;br /&gt;
LEFT JOIN prefix_survey AS survey ON survey.id = cm.instance AND m.name = &#039;survey&#039;&lt;br /&gt;
LEFT JOIN prefix_url AS url ON url.id = cm.instance AND m.name = &#039;url&#039;&lt;br /&gt;
LEFT JOIN prefix_wiki AS wiki ON wiki.id = cm.instance AND m.name = &#039;wiki&#039;&lt;br /&gt;
LEFT JOIN prefix_workshop AS workshop ON workshop.id = cm.instance AND m.name = &#039;workshop&#039;&lt;br /&gt;
LEFT JOIN prefix_kalvidassign AS kalvidassign ON kalvidassign.id = cm.instance AND m.name = &#039;kalvidassign&#039;&lt;br /&gt;
LEFT JOIN prefix_kalvidres AS kvr ON kvr.id = cm.instance AND m.name = &#039;kalvidres&#039;&lt;br /&gt;
LEFT JOIN prefix_attendance AS attendance ON attendance.id = cm.instance AND m.name = &#039;attendance&#039;&lt;br /&gt;
LEFT JOIN prefix_checklist AS checklist ON checklist.id = cm.instance AND m.name = &#039;checklist&#039;&lt;br /&gt;
LEFT JOIN prefix_flashcard AS flashcard ON flashcard.id = cm.instance AND m.name = &#039;flashcard&#039;&lt;br /&gt;
LEFT JOIN prefix_lti AS lti ON lti.id = cm.instance AND m.name = &#039;lti&#039;&lt;br /&gt;
LEFT JOIN prefix_oublog AS oublog ON oublog.id = cm.instance AND m.name = &#039;oublog&#039;&lt;br /&gt;
LEFT JOIN prefix_ouwiki AS ouwiki ON ouwiki.id = cm.instance AND m.name = &#039;ouwiki&#039;&lt;br /&gt;
LEFT JOIN prefix_subpage AS subpage ON subpage.id = cm.instance AND m.name = &#039;subpage&#039;&lt;br /&gt;
LEFT JOIN prefix_journal AS journal ON journal.id = cm.instance AND m.name = &#039;journal&#039;&lt;br /&gt;
LEFT JOIN prefix_lightboxgallery AS lightboxgallery ON lightboxgallery.id = cm.instance AND m.name = &#039;lightboxgallery&#039;&lt;br /&gt;
LEFT JOIN prefix_elluminate AS elluminate ON elluminate.id = cm.instance AND m.name = &#039;elluminate&#039;&lt;br /&gt;
LEFT JOIN prefix_adaptivequiz AS adaptivequiz ON adaptivequiz.id = cm.instance AND m.name = &#039;adaptivequiz&#039;&lt;br /&gt;
LEFT JOIN prefix_hotpot AS hotpot ON hotpot.id = cm.instance AND m.name = &#039;hotpot&#039;&lt;br /&gt;
LEFT JOIN prefix_wiziq AS wiziq ON wiziq.id = cm.instance AND m.name = &#039;wiziq&#039;&lt;br /&gt;
LEFT JOIN prefix_turnitintooltwo AS turnitintooltwo ON turnitintooltwo.id = cm.instance AND m.name = &#039;turnitintooltwo&#039;&lt;br /&gt;
&lt;br /&gt;
LEFT JOIN prefix_logstore_standard_log AS l ON l.userid = u.id AND l.courseid = c.id&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
WHERE ra.roleid =5&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
AND cs.visible = 1&lt;br /&gt;
AND cm.visible = 1&lt;br /&gt;
&lt;br /&gt;
AND c.id = %%COURSEID%%&lt;br /&gt;
&lt;br /&gt;
GROUP BY cm.id&lt;br /&gt;
&lt;br /&gt;
ORDER BY cs.section&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Module activity (Hits) between dates===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT module, COUNT( * ) &lt;br /&gt;
FROM prefix_logstore_standard_log AS l&lt;br /&gt;
WHERE (FROM_UNIXTIME( l.`timecreated` ) BETWEEN  &#039;2018-10-01 00:00:00&#039; AND  &#039;2019-09-31 00:00:00&#039;)&lt;br /&gt;
GROUP BY module&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Module activity (Instances and Hits) for each academic year===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT name&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_logstore_standard_log AS l&lt;br /&gt;
WHERE (FROM_UNIXTIME(l.`timecreated`) BETWEEN &#039;2017-10-01 00:00:00&#039; AND &#039;2018-09-31 00:00:00&#039;)&lt;br /&gt;
AND l.module = m.name AND l.action = &#039;add&#039;&lt;br /&gt;
) AS &amp;quot;Added 2017&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_logstore_standard_log AS l&lt;br /&gt;
WHERE (FROM_UNIXTIME(l.`timecreated`) BETWEEN &#039;2017-10-01 00:00:00&#039; AND &#039;2018-09-31 00:00:00&#039;)&lt;br /&gt;
AND l.module = m.name&lt;br /&gt;
) AS &amp;quot;Used 2017&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_logstore_standard_log AS l&lt;br /&gt;
WHERE (FROM_UNIXTIME(l.`timecreated`) BETWEEN &#039;2018-10-01 00:00:00&#039; AND &#039;2019-09-31 00:00:00&#039;)&lt;br /&gt;
AND l.module = m.name AND l.action = &#039;add&#039;&lt;br /&gt;
) AS &amp;quot;Added 2018&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_logstore_standard_log AS l&lt;br /&gt;
WHERE (FROM_UNIXTIME(l.`timecreated`) BETWEEN &#039;2018-10-01 00:00:00&#039; AND &#039;2019-09-31 00:00:00&#039;)&lt;br /&gt;
AND l.module = m.name&lt;br /&gt;
) AS &amp;quot;Used 2018&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_logstore_standard_log AS l&lt;br /&gt;
WHERE (FROM_UNIXTIME(l.`timecreated`) BETWEEN &#039;2019-10-01 00:00:00&#039; AND &#039;2020-09-31 00:00:00&#039;)&lt;br /&gt;
AND l.module = m.name AND l.action = &#039;add&#039;&lt;br /&gt;
) AS &amp;quot;Added 2019&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_logstore_standard_log AS l&lt;br /&gt;
WHERE (FROM_UNIXTIME(l.`timecreated`) BETWEEN &#039;2019-10-01 00:00:00&#039; AND &#039;2020-09-31 00:00:00&#039;)&lt;br /&gt;
AND l.module = m.name&lt;br /&gt;
) AS &amp;quot;Used 2019&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM mdl_modules AS m&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unique user sessions per day and month + graph===&lt;br /&gt;
The &amp;quot;graph&amp;quot; column is used when displaying a graph (which needs at least three columns to pick from)&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT COUNT(DISTINCT userid) AS &amp;quot;Unique User Logins&amp;quot;&lt;br /&gt;
,DATE_FORMAT(FROM_UNIXTIME(timecreated), &amp;quot;%y /%m / %d&amp;quot;) AS &amp;quot;Year / Month / Day&amp;quot;, &amp;quot;Graph&amp;quot; &lt;br /&gt;
FROM `mdl_logstore_standard_log` &lt;br /&gt;
WHERE action LIKE &#039;loggedin&#039;&lt;br /&gt;
#AND timecreated &amp;gt;  UNIX_TIMESTAMP(&#039;2015-01-01 00:00:00&#039;) # optional start date&lt;br /&gt;
#AND timecreated &amp;lt;= UNIX_TIMESTAMP(&#039;2015-01-31 23:59:00&#039;) # optional end date&lt;br /&gt;
GROUP BY MONTH(FROM_UNIXTIME(timecreated)), DAY(FROM_UNIXTIME(timecreated))&lt;br /&gt;
ORDER BY MONTH(FROM_UNIXTIME(timecreated)), DAY(FROM_UNIXTIME(timecreated))&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And...&lt;br /&gt;
&lt;br /&gt;
Counting user&#039;s global and unique hits per day + counting individual usage of specific activities and resources (on that day),&lt;br /&gt;
&lt;br /&gt;
And since I am using phpMyAdmin&#039;s &amp;quot;Display Graph&amp;quot; feature (at the bottom of the query&#039;s output page), I have scaled down the &amp;quot;User Hits&amp;quot; by 10 to fit the graph. that&#039;s it.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT DATE_FORMAT(FROM_UNIXTIME(timecreated), &amp;quot;%y-%m-%d&amp;quot;) AS &amp;quot;Datez&amp;quot;&lt;br /&gt;
,COUNT(DISTINCT userid) AS &amp;quot;Unique Users&amp;quot;&lt;br /&gt;
,ROUND(COUNT(*)/10) &amp;quot;User Hits (K)&amp;quot;&lt;br /&gt;
,SUM(IF(component=&#039;mod_quiz&#039;,1,0)) &amp;quot;Quizzes&amp;quot;&lt;br /&gt;
,SUM(IF(component=&#039;mod_forum&#039; or component=&#039;mod_forumng&#039;,1,0)) &amp;quot;Forums&amp;quot;&lt;br /&gt;
,SUM(IF(component=&#039;mod_assign&#039;,1,0)) &amp;quot;Assignments&amp;quot;&lt;br /&gt;
,SUM(IF(component=&#039;mod_oublog&#039;,1,0)) &amp;quot;Blogs&amp;quot;&lt;br /&gt;
,SUM(IF(component=&#039;mod_resource&#039;,1,0)) &amp;quot;Files (Resource)&amp;quot;&lt;br /&gt;
,SUM(IF(component=&#039;mod_url&#039;,1,0)) &amp;quot;Links (Resource)&amp;quot;&lt;br /&gt;
,SUM(IF(component=&#039;mod_page&#039;,1,0)) &amp;quot;Pages (Resource)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM `mdl_logstore_standard_log` &lt;br /&gt;
WHERE 1=1&lt;br /&gt;
AND timecreated &amp;gt;  UNIX_TIMESTAMP(&#039;2015-03-01 00:00:00&#039;) # optional START DATE&lt;br /&gt;
AND timecreated &amp;lt;= UNIX_TIMESTAMP(&#039;2015-05-31 23:59:00&#039;) # optional END DATE&lt;br /&gt;
GROUP BY MONTH(FROM_UNIXTIME(timecreated)), DAY(FROM_UNIXTIME(timecreated))&lt;br /&gt;
ORDER BY MONTH(FROM_UNIXTIME(timecreated)), DAY(FROM_UNIXTIME(timecreated))&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System wide, daily unique user hits for the last 7 days===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
  DATE_FORMAT(FROM_UNIXTIME(l.timecreated), &#039;%m%d&#039;) &#039;Day&#039;&lt;br /&gt;
  ,COUNT(DISTINCT l.userid) AS &#039;Distinct Users Hits&#039;&lt;br /&gt;
  ,COUNT( l.userid) AS &#039;Users Hits&#039;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_logstore_standard_log AS l&lt;br /&gt;
WHERE l.courseid &amp;gt; 1&lt;br /&gt;
      AND FROM_UNIXTIME(l.timecreated) &amp;gt;= DATE_SUB(NOW(), INTERVAL 7 DAY)&lt;br /&gt;
GROUP BY DAY(FROM_UNIXTIME(timecreated))&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===User detailed activity in course modules===&lt;br /&gt;
Considering only several modules: url, resource, forum, quiz, questionnaire.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.id, ra.roleid,&lt;br /&gt;
CONCAT(u.lastname, &#039; &#039;, u.firstname) AS &#039;Student&#039;&lt;br /&gt;
,COUNT(l.id) AS &#039;Actions&#039;&lt;br /&gt;
,l.component &amp;quot;Module type&amp;quot;&lt;br /&gt;
,l.objectid &amp;quot;Module ID&amp;quot;&lt;br /&gt;
,CASE &lt;br /&gt;
  WHEN l.component = &#039;mod_url&#039; THEN (SELECT u.name FROM prefix_url AS u WHERE u.id = l.objectid )&lt;br /&gt;
  WHEN l.component = &#039;mod_resource&#039; THEN (SELECT r.name FROM prefix_resource AS r WHERE r.id = l.objectid )&lt;br /&gt;
  WHEN l.component = &#039;mod_forum&#039; THEN (SELECT f.name FROM prefix_forum AS f WHERE f.id = l.objectid )&lt;br /&gt;
  WHEN l.component = &#039;mod_quiz&#039; THEN (SELECT q.name FROM prefix_quiz AS q WHERE q.id = l.objectid )&lt;br /&gt;
  WHEN l.component = &#039;mod_questionnaire&#039; THEN (SELECT q.name FROM prefix_questionnaire AS q WHERE q.id = l.objectid )&lt;br /&gt;
END AS &#039;Module name&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT GROUP_CONCAT(g.name) FROM prefix_groups AS g&lt;br /&gt;
JOIN prefix_groups_members AS m ON g.id = m.groupid WHERE g.courseid = l.courseid AND m.userid = u.id) &amp;quot;user_groups&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT s.name &lt;br /&gt;
  FROM prefix_course_modules AS cm &lt;br /&gt;
  JOIN prefix_course_sections AS s ON s.course = cm.course AND s.id = cm.section &lt;br /&gt;
  WHERE cm.id = l.contextinstanceid) AS &amp;quot;Section name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_logstore_standard_log AS l  &lt;br /&gt;
JOIN prefix_user AS u ON u.id = l.userid&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.userid = l.userid &lt;br /&gt;
  AND ra.contextid = (SELECT id FROM prefix_context WHERE instanceid = l.courseid AND contextlevel = 50) &lt;br /&gt;
WHERE l.courseid = %%COURSEID%%&lt;br /&gt;
  AND l.component IN (&#039;mod_url&#039;, &#039;mod_resource&#039;, &#039;mod_forum&#039;, &#039;mod_quiz&#039;, &#039;mod_questionnaire&#039;) &lt;br /&gt;
  %%FILTER_STARTTIME:l.timecreated:&amp;gt;%% %%FILTER_ENDTIME:l.timecreated:&amp;lt;%%&lt;br /&gt;
 &lt;br /&gt;
GROUP BY u.id, l.component&lt;br /&gt;
ORDER BY u.lastname, u.firstname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===What teachers and courses considered active?===&lt;br /&gt;
This report display several calculations and parameters that help the Online academic training team find teachers that might need more support getting their courses more supporting of online learning pedagogical methodologies.  &lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,&lt;br /&gt;
			  course.id,&#039;&amp;quot;&amp;gt;&#039;,course.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course &lt;br /&gt;
&lt;br /&gt;
#,course.shortname&lt;br /&gt;
&lt;br /&gt;
,CASE &lt;br /&gt;
  WHEN course.fullname LIKE &#039;%2012%&#039; THEN &#039;2012&#039;&lt;br /&gt;
  WHEN course.fullname LIKE &#039;%2013%&#039; THEN &#039;2013&#039; &lt;br /&gt;
  WHEN course.fullname LIKE &#039;%2014%&#039; THEN &#039;2014&#039;&lt;br /&gt;
  WHEN course.fullname LIKE &#039;%2015%&#039; THEN &#039;2015&#039;&lt;br /&gt;
END AS Year&lt;br /&gt;
&lt;br /&gt;
,CASE &lt;br /&gt;
  WHEN course.fullname LIKE &#039;%semester a%&#039; THEN &#039;Spring semester&#039;&lt;br /&gt;
  WHEN course.fullname LIKE &#039;%semester b%&#039; THEN &#039;Fall semester&#039;&lt;br /&gt;
  WHEN course.fullname LIKE &#039;%semester s%&#039; THEN &#039;Summer semester&#039;&lt;br /&gt;
END AS Semester&lt;br /&gt;
&lt;br /&gt;
,IF(course.startdate&amp;gt;0, DATE_FORMAT(FROM_UNIXTIME(startdate), &#039;%d-%m-%Y&#039;), &#039;no date&#039;) AS &amp;quot;Course Start Date&amp;quot; &lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT( ra.userid ) AS Users&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5 AND ctx.instanceid = course.id&lt;br /&gt;
) AS Students&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT( ra.userid ) AS Users&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 4 AND ctx.instanceid = course.id&lt;br /&gt;
) AS &amp;quot;Assistant teacher&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT( ra.userid ) AS Users&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = course.id&lt;br /&gt;
) AS Teachers&lt;br /&gt;
&lt;br /&gt;
# Uncomment to use the new Moodle 2.8+ logstore&lt;br /&gt;
#,(SELECT COUNT(*) FROM mdl_logstore_standard_log AS l WHERE l.courseid = course.id) AS Hits&lt;br /&gt;
&lt;br /&gt;
#,(SELECT COUNT(*)&lt;br /&gt;
#FROM mdl_logstore_standard_log AS l&lt;br /&gt;
#JOIN mdl_role_assignments AS ra ON ra.userid= l.userid AND ra.roleid = 5 AND ra.contextid = (SELECT id FROM mdl_context WHERE instanceid = l.courseid AND contextlevel = 50) &lt;br /&gt;
#WHERE l.courseid = course.id ) AS &amp;quot;Student HITs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#,(SELECT COUNT(*)&lt;br /&gt;
#FROM mdl_logstore_standard_log AS l&lt;br /&gt;
#JOIN mdl_role_assignments AS ra ON ra.userid= l.userid AND ra.roleid = 3 AND ra.contextid = (SELECT id FROM mdl_context WHERE instanceid = l.courseid AND contextlevel = 50) &lt;br /&gt;
#WHERE l.courseid = course.id ) AS &amp;quot;Teacher HITs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) FROM mdl_log AS l WHERE l.course = course.id) AS Hits&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*)&lt;br /&gt;
FROM mdl_log AS l&lt;br /&gt;
JOIN mdl_context AS con ON con.instanceid= l.course AND con.contextlevel=50&lt;br /&gt;
JOIN mdl_role_assignments AS ra ON ra.contextid= con.id AND ra.userid= l.userid AND ra.roleid = 5 &lt;br /&gt;
WHERE l.course = course.id) AS &amp;quot;Students HITs&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
,(SELECT COUNT(*)&lt;br /&gt;
FROM mdl_log AS l&lt;br /&gt;
JOIN mdl_context AS con ON con.instanceid= l.course AND con.contextlevel=50&lt;br /&gt;
JOIN mdl_role_assignments AS ra ON ra.contextid= con.id AND ra.userid= l.userid AND ra.roleid = 3 &lt;br /&gt;
WHERE l.course = course.id) AS &amp;quot;Teachers HITs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT GROUP_CONCAT( CONCAT( u.firstname,  &amp;quot; &amp;quot;, u.lastname ) ) &lt;br /&gt;
FROM prefix_course c&lt;br /&gt;
JOIN prefix_context con ON con.instanceid = c.id&lt;br /&gt;
JOIN prefix_role_assignments ra ON con.id = ra.contextid AND con.contextlevel = 50&lt;br /&gt;
JOIN prefix_role r ON ra.roleid = r.id&lt;br /&gt;
JOIN prefix_user u ON u.id = ra.userid&lt;br /&gt;
WHERE r.id = 3 AND c.id = course.id&lt;br /&gt;
GROUP BY c.id&lt;br /&gt;
) AS Teachers&lt;br /&gt;
  &lt;br /&gt;
,(SELECT COUNT(*) FROM prefix_course_modules cm WHERE cm.course = course.id) Modules&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(DISTINCT cm.module) FROM prefix_course_modules cm &lt;br /&gt;
  WHERE cm.course = course.id) UniqueModules&lt;br /&gt;
&lt;br /&gt;
,(SELECT GROUP_CONCAT(DISTINCT m.name) &lt;br /&gt;
  FROM prefix_course_modules cm &lt;br /&gt;
  JOIN mdl_modules as m ON m.id = cm.module&lt;br /&gt;
  WHERE cm.course = course.id) UniqueModuleNames&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) FROM mdl_course_modules cm JOIN mdl_modules as m ON m.id = cm.module &lt;br /&gt;
  WHERE cm.course = course.id AND m.name IN ( &#039;ouwiki&#039;, &#039;wiki&#039;) ) &amp;quot;Num Wikis&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) FROM mdl_course_modules cm JOIN mdl_modules as m ON m.id = cm.module &lt;br /&gt;
  WHERE cm.course = course.id AND m.name IN ( &#039;oublog&#039;) ) &amp;quot;Num Blogs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) FROM mdl_course_modules cm JOIN mdl_modules as m ON m.id = cm.module &lt;br /&gt;
  WHERE cm.course = course.id AND m.name IN ( &#039;forum&#039;, &#039;forumng&#039;) ) &amp;quot;Num Forums&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) FROM prefix_course_modules cm JOIN mdl_modules as m ON m.id = cm.module &lt;br /&gt;
  WHERE cm.course = course.id AND m.name IN (&#039;resource&#039;, &#039;folder&#039;, &#039;url&#039;, &#039;tab&#039;, &#039;file&#039;, &#039;book&#039;, &#039;page&#039;) ) Resources&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) FROM prefix_course_modules cm JOIN mdl_modules as m ON m.id = cm.module &lt;br /&gt;
  WHERE cm.course = course.id AND m.name IN (&#039;forum&#039;, &#039;forumng&#039;, &#039;oublog&#039;, &#039;page&#039;, &#039;file&#039;, &#039;url&#039;, &#039;wiki&#039; , &#039;ouwiki&#039;) ) &amp;quot;Basic Activities&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) FROM prefix_course_modules cm JOIN mdl_modules as m ON m.id = cm.module &lt;br /&gt;
  WHERE cm.course = course.id AND m.name IN (&#039;advmindmap&#039;, &#039;assign&#039;, &#039;attendance&#039;, &#039;book&#039;, &#039;choice&#039;, &#039;folder&#039;, &#039;tab&#039;, &#039;glossary&#039;, &#039;questionnaire&#039;, &#039;quiz&#039;, &#039;label&#039; ) ) &amp;quot;Avarage Activities&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) FROM prefix_course_modules cm JOIN mdl_modules as m ON m.id = cm.module &lt;br /&gt;
  WHERE cm.course = course.id AND m.name IN (&#039;elluminate&#039;, &#039;game&#039;, &#039;workshop&#039;) ) &amp;quot;Advanced Activities&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS course&lt;br /&gt;
&lt;br /&gt;
#WHERE course.shortname LIKE &#039;%2015%&#039;&lt;br /&gt;
#WHERE 1=1&lt;br /&gt;
#%%FILTER_SEARCHTEXT:course.shortname:~%%&lt;br /&gt;
&lt;br /&gt;
WHERE course.fullname LIKE &#039;%2015%&#039; &lt;br /&gt;
&lt;br /&gt;
HAVING Modules &amp;gt; 2&lt;br /&gt;
ORDER BY UniqueModules DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Weekly attendance report===&lt;br /&gt;
This report display weekly report in format HH:M:SS This MySQL query works together with AttendaceRegister module, and gather Log information from Attendanceregister_log table. &lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.username, SEC_TO_TIME (SUM(arsess.duration)) AS weekly_online_attendance,  FROM_UNIXTIME (arsess.logout) AS Last_Logout&lt;br /&gt;
FROM prefix_attendanceregister_session AS arsess&lt;br /&gt;
JOIN prefix_user AS u ON arsess.userid = u.id&lt;br /&gt;
&lt;br /&gt;
WHERE (((arsess.logout) BETWEEN UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 7 DAY)) AND UNIX_TIMESTAMP(CURDATE())))&lt;br /&gt;
&lt;br /&gt;
GROUP BY arsess.userid&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How many distinct users connected to Moodle using the app by month===&lt;br /&gt;
https://moodle.org/mod/forum/discuss.php?d=336086#p1354194 by &lt;br /&gt;
Iñigo Zendegi Urzelai&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
  to_char(to_timestamp(&amp;quot;timecreated&amp;quot;),&#039;YYYY&#039;) as year, &lt;br /&gt;
  to_char(to_timestamp(&amp;quot;timecreated&amp;quot;),&#039;MM&#039;) as month, &lt;br /&gt;
  count(distinct userid) as distinct_users&lt;br /&gt;
&lt;br /&gt;
FROM prefix_logstore_standard_log l&lt;br /&gt;
WHERE l.origin=&#039;ws&#039;&lt;br /&gt;
GROUP BY to_char(to_timestamp(&amp;quot;timecreated&amp;quot;),&#039;YYYY&#039;), to_char(to_timestamp(&amp;quot;timecreated&amp;quot;),&#039;MM&#039;) &lt;br /&gt;
ORDER BY to_char(to_timestamp(&amp;quot;timecreated&amp;quot;),&#039;YYYY&#039;), to_char(to_timestamp(&amp;quot;timecreated&amp;quot;),&#039;MM&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Course Reports==&lt;br /&gt;
===Most Active courses===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT count(l.userid) AS Views&lt;br /&gt;
FROM `mdl_logstore_standard_log` l, `mdl_user` u, `mdl_role_assignments` r&lt;br /&gt;
WHERE l.courseid=35&lt;br /&gt;
AND l.userid = u.id&lt;br /&gt;
AND (l.timecreated &amp;gt; UNIX_TIMESTAMP(&#039;2015-01-01 00:00:00&#039;) AND l.timecreated &amp;lt;= UNIX_TIMESTAMP(&#039;2015-01-31 23:59:59&#039;))AND r.contextid= (&lt;br /&gt;
	 SELECT id&lt;br /&gt;
	 FROM mdl_context&lt;br /&gt;
	 WHERE contextlevel=50 AND instanceid=l.courseid&lt;br /&gt;
)&lt;br /&gt;
AND r.roleid=5&lt;br /&gt;
AND r.userid = u.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Active courses, advanced===&lt;br /&gt;
Including: Teacher&#039;s name, link to the course, All types of log activities, special YEAR generated field, Activities and Resource count, enrolled Student count&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT COUNT(l.id) hits, concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course &lt;br /&gt;
&lt;br /&gt;
,(SELECT CONCAT(u.firstname,&#039; &#039;, u.lastname) AS Teacher&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) AS Teacher&lt;br /&gt;
&lt;br /&gt;
,CASE &lt;br /&gt;
  WHEN c.fullname LIKE &#039;%תשע&#039; THEN &#039;תשע&#039;&lt;br /&gt;
  WHEN c.fullname LIKE &#039;%תשעא&#039; THEN &#039;תשעא&#039;&lt;br /&gt;
  WHEN c.fullname LIKE &#039;%תשעב&#039; THEN &#039;תשעב&#039;&lt;br /&gt;
END AS Year&lt;br /&gt;
&lt;br /&gt;
,(SELECT count(*) FROM prefix_course_modules cm WHERE cm.course = l.course) Modules&lt;br /&gt;
&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5 AND ctx.instanceid = c.id) AS Students&lt;br /&gt;
&lt;br /&gt;
FROM prefix_log l &lt;br /&gt;
INNER JOIN prefix_course c ON l.course = c.id&lt;br /&gt;
GROUP BY c.id&lt;br /&gt;
#The following line restricts the courses returned to those having more than 2 modules.  Adjust based on your needs.&lt;br /&gt;
HAVING Modules &amp;gt; 2&lt;br /&gt;
ORDER BY Year DESC, hits DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Least active or probably empty courses===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
It is difficult to know sometimes when a course is actually empty or was never really in use. Other than the simple case where the course was created and never touched again, in which case the course timecreated and timemodified will be the same, many courses created as shells for teachers or other users may be used once or a few times and have few or no test users enrollments in them. This query helps you see the range of such courses, showing you how many days if any it was used after initial creation, and how many user are enrolled. It denotes a course never ever modified by &amp;quot;-1&amp;quot; instead of &amp;quot;0&amp;quot; so you can sort those to the top. By default it limits this to courses used within 60 days of creation, and to courses with 3 or less enrollments (for example, teacher and assistant and test student account only.) You can easily adjust these numbers. The query includes a link to the course as well. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
c.fullname,&lt;br /&gt;
CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php&#039;,CHAR(63),&#039;id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.shortname,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;CourseLink&#039;,&lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(c.timecreated), &#039;%Y-%m-%d %H:%i&#039;) AS &#039;Timecreated&#039;,&lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(c.timemodified), &#039;%Y-%m-%d %H:%i&#039;) AS &#039;Timemodified&#039;,&lt;br /&gt;
CASE&lt;br /&gt;
 WHEN c.timecreated = c.timemodified THEN &#039;-1&#039;&lt;br /&gt;
 ELSE DATEDIFF(FROM_UNIXTIME(c.timemodified),FROM_UNIXTIME(c.timecreated))&lt;br /&gt;
END AS &#039;DateDifference&#039;,&lt;br /&gt;
COUNT(ue.id) AS Enroled&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_enrol AS en ON en.courseid = c.id&lt;br /&gt;
LEFT JOIN prefix_user_enrolments AS ue ON ue.enrolid = en.id&lt;br /&gt;
WHERE DATEDIFF(FROM_UNIXTIME(c.timemodified),FROM_UNIXTIME(c.timecreated) ) &amp;lt; 60&lt;br /&gt;
GROUP BY c.id&lt;br /&gt;
HAVING COUNT(ue.id) &amp;lt;= 3&lt;br /&gt;
ORDER BY c.fullname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Count unique teachers with courses that use at least X module (Moodle19)===&lt;br /&gt;
You can remove the outer &amp;quot;SELECT COUNT(*) FROM (...) AS ActiveTeachers&amp;quot; SQL query and get the list of the Teachers and Courses.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT COUNT(*)&lt;br /&gt;
FROM (SELECT c.id AS CourseID, c.fullname AS Course, ra.roleid AS RoleID, CONCAT(u.firstname, &#039; &#039;, u.lastname) AS Teacher&lt;br /&gt;
,(SELECT COUNT(*) FROM prefix_course_modules cm WHERE cm.course = c.id) AS Modules&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_context AS ctx ON c.id = ctx.instanceid AND ctx.contextlevel = 50 &lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
WHERE  ra.roleid = 3 &lt;br /&gt;
GROUP BY u.id&lt;br /&gt;
HAVING Modules &amp;gt; 5) AS ActiveTeachers&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===RESOURCE count for each COURSE===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT COUNT(l.id) count, l.course, c.fullname coursename&lt;br /&gt;
FROM prefix_resource l INNER JOIN prefix_course c on l.course = c.id&lt;br /&gt;
GROUP BY course&lt;br /&gt;
ORDER BY count DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Common resource types count for each Category (Moodle19)===&lt;br /&gt;
Including sub-categories in total count.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT mcc.id AS mccid, CONCAT( LPAD( &#039;&#039;, mcc.depth, &#039;.&#039; ) , mcc.name ) AS Category&lt;br /&gt;
,(SELECT COUNT( * ) &lt;br /&gt;
FROM prefix_resource AS r&lt;br /&gt;
JOIN prefix_course AS c ON c.id = r.course&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
WHERE cc.path LIKE CONCAT( &#039;%&#039;, mccid, &#039;%&#039; ) AND r.TYPE = &#039;file&#039; AND r.reference LIKE &#039;http://%&#039;&lt;br /&gt;
) AS Links&lt;br /&gt;
 &lt;br /&gt;
,(SELECT COUNT( * ) &lt;br /&gt;
FROM prefix_resource AS r&lt;br /&gt;
JOIN prefix_course AS c ON c.id = r.course&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
WHERE cc.path LIKE CONCAT( &#039;%&#039;, mccid, &#039;%&#039; ) AND r.TYPE = &#039;file&#039; AND r.reference NOT LIKE &#039;http://%&#039;&lt;br /&gt;
) AS Files&lt;br /&gt;
 &lt;br /&gt;
,(SELECT COUNT( * ) &lt;br /&gt;
FROM prefix_resource AS r&lt;br /&gt;
JOIN prefix_course AS c ON c.id = r.course&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
WHERE cc.path LIKE CONCAT( &#039;%&#039;, mccid, &#039;%&#039; ) AND r.TYPE = &#039;directory&#039; &lt;br /&gt;
) AS Folders&lt;br /&gt;
 &lt;br /&gt;
,(SELECT COUNT( * ) &lt;br /&gt;
FROM prefix_resource AS r&lt;br /&gt;
JOIN prefix_course AS c ON c.id = r.course&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
WHERE cc.path LIKE CONCAT( &#039;%&#039;, mccid, &#039;%&#039; ) AND r.TYPE = &#039;html&#039; &lt;br /&gt;
) AS Pages&lt;br /&gt;
 &lt;br /&gt;
,(SELECT COUNT(*) &lt;br /&gt;
FROM stats_log_context_role_course &lt;br /&gt;
WHERE roleid = 5 AND module = &#039;resource&#039; AND category = mcc.id&lt;br /&gt;
) AS Hits&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course_categories AS mcc&lt;br /&gt;
ORDER BY mcc.path&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Where &amp;quot;stats_log_context_role_course&amp;quot; (in the above SQL query) is a VIEW generated by:&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
CREATE VIEW stats_log_context_role_course AS&lt;br /&gt;
SELECT l.course, c.category, cc.path, l.module, l.action, ra.userid, ra.roleid&lt;br /&gt;
FROM prefix_log AS l&lt;br /&gt;
JOIN prefix_context AS context ON context.instanceid = l.course AND context.contextlevel = 50&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.userid = l.userid AND ra.contextid = context.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = l.course&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same query but for Moodle2+&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT mcc.id AS mccid, CONCAT( LPAD( &#039;&#039;, mcc.depth, &#039;.&#039; ) , mcc.name ) AS Category,&lt;br /&gt;
mcc.path,&lt;br /&gt;
&lt;br /&gt;
(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_url AS u&lt;br /&gt;
JOIN prefix_course AS c ON c.id = u.course&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
WHERE cc.path LIKE CONCAT( &#039;%/&#039;, mccid, &#039;%&#039; )&lt;br /&gt;
) AS URLs,&lt;br /&gt;
&lt;br /&gt;
(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_folder AS f&lt;br /&gt;
JOIN prefix_course AS c ON c.id = f.course&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
WHERE cc.path LIKE CONCAT( &#039;%/&#039;, mccid, &#039;%&#039; )&lt;br /&gt;
) AS FOLDERs,&lt;br /&gt;
&lt;br /&gt;
(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_page AS p&lt;br /&gt;
JOIN prefix_course AS c ON c.id = p.course&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
WHERE cc.path LIKE CONCAT( &#039;%/&#039;, mccid, &#039;%&#039; )&lt;br /&gt;
) AS PAGEs,&lt;br /&gt;
&lt;br /&gt;
(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_book AS b&lt;br /&gt;
JOIN prefix_course AS c ON c.id = b.course&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
WHERE cc.path LIKE CONCAT( &#039;%/&#039;, mccid, &#039;%&#039; )&lt;br /&gt;
) AS BOOKs,&lt;br /&gt;
&lt;br /&gt;
(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_label AS l&lt;br /&gt;
JOIN prefix_course AS c ON c.id = l.course&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
WHERE cc.path LIKE CONCAT( &#039;%/&#039;, mccid, &#039;%&#039; )&lt;br /&gt;
) AS LABELs,&lt;br /&gt;
&lt;br /&gt;
(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_tab AS t&lt;br /&gt;
JOIN prefix_course AS c ON c.id = t.course&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
WHERE cc.path LIKE CONCAT( &#039;%/&#039;, mccid, &#039;%&#039; )&lt;br /&gt;
) AS TABs&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course_categories AS mcc&lt;br /&gt;
ORDER BY mcc.path&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Detailed Resource COUNT by Teacher in each course===&lt;br /&gt;
&lt;br /&gt;
Including (optional) filter by: year, semester and course id.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS CourseID&lt;br /&gt;
, c.id&lt;br /&gt;
,( SELECT DISTINCT CONCAT(u.firstname,&#039; &#039;,u.lastname)&lt;br /&gt;
  FROM prefix_role_assignments AS ra&lt;br /&gt;
  JOIN prefix_user AS u ON ra.userid = u.id&lt;br /&gt;
  JOIN prefix_context AS ctx ON ctx.id = ra.contextid&lt;br /&gt;
  WHERE ra.roleid = 3 AND ctx.instanceid = c.id AND ctx.contextlevel = 50 LIMIT 1) AS Teacher&lt;br /&gt;
&lt;br /&gt;
, (CASE &lt;br /&gt;
WHEN c.fullname LIKE &#039;%תשעב%&#039; THEN &#039;2012&#039; &lt;br /&gt;
WHEN c.fullname LIKE &#039;%תשעא%&#039; THEN &#039;2011&#039;&lt;br /&gt;
END ) as Year&lt;br /&gt;
, (CASE &lt;br /&gt;
WHEN c.fullname LIKE &#039;%סמסטר א%&#039; THEN &#039;Semester A&#039; &lt;br /&gt;
WHEN c.fullname LIKE &#039;%סמסטר ב%&#039; THEN &#039;Semester B&#039;&lt;br /&gt;
WHEN c.fullname LIKE &#039;%סמסטר ק%&#039; THEN &#039;Semester C&#039;&lt;br /&gt;
END ) as Semester&lt;br /&gt;
,COUNT(c.id) AS Total&lt;br /&gt;
,(SELECT count(*) FROM prefix_course_modules AS cm WHERE cm.course = c.id AND cm.module= 20) AS TABs&lt;br /&gt;
,(SELECT count(*) FROM prefix_course_modules AS cm WHERE cm.course = c.id AND cm.module= 33) AS BOOKs&lt;br /&gt;
&lt;br /&gt;
FROM `prefix_resource` as r &lt;br /&gt;
JOIN `prefix_course` AS c on c.id = r.course&lt;br /&gt;
#WHERE type= &#039;file&#039; and reference NOT LIKE &#039;http://%&#039; &lt;br /&gt;
&lt;br /&gt;
#WHERE 1=1&lt;br /&gt;
#%%FILTER_YEARS:c.fullname%%&lt;br /&gt;
#AND c.fullname LIKE &#039;%2013%&#039;&lt;br /&gt;
&lt;br /&gt;
GROUP BY course&lt;br /&gt;
ORDER BY COUNT(c.id) DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Courses that are defined as using GROUPs===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/group/index.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
,(SELECT count(*) FROM prefix_course_modules cm WHERE cm.course = c.id) Modules&lt;br /&gt;
,(SELECT count(*) FROM prefix_groups g WHERE g.courseid = c.id) Groups&lt;br /&gt;
 FROM `prefix_course` AS c&lt;br /&gt;
WHERE groupmode &amp;gt; 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Courses with Groups===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
List of all courses with Groups in them (groupmode &amp;gt; 0). You can also use groupmode=1 to list just Separate type groups or groupmode=2 to list Visible type groups.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.shortname, g.name, c.groupmode&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_groups AS g ON c.id = g.courseid&lt;br /&gt;
WHERE c.groupmode &amp;gt; 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Users enrolled in a course with groups but not assigned a group ===&lt;br /&gt;
&lt;br /&gt;
Displays by course all enrolled users that have not been assigned a group in courses that have groups. NOTE: This needs to be optimized.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT DISTINCT&lt;br /&gt;
user2.firstname AS Firstname,&lt;br /&gt;
user2.lastname AS Lastname,&lt;br /&gt;
user2.email AS Email,&lt;br /&gt;
user2.city AS City,&lt;br /&gt;
course.fullname AS Course&lt;br /&gt;
,(SELECT shortname FROM prefix_role WHERE id=en.roleid) AS ROLE&lt;br /&gt;
,(SELECT name FROM prefix_role WHERE id=en.roleid) AS RoleName&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS course &lt;br /&gt;
JOIN prefix_enrol AS en ON en.courseid = course.id&lt;br /&gt;
JOIN prefix_user_enrolments AS ue ON ue.enrolid = en.id&lt;br /&gt;
JOIN prefix_user AS user2 ON ue.userid = user2.id&lt;br /&gt;
JOIN prefix_groups AS g ON g.courseid = course.id&lt;br /&gt;
&lt;br /&gt;
WHERE ue.enrolid NOT IN (select userid from prefix_groups_members WHERE g.id=groupid)&lt;br /&gt;
&lt;br /&gt;
ORDER BY Course, Lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Groups in course with member list===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
List the groups in a course (replace the # by the course id number) with the members of each group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.shortname, g.name AS Groupname, u.username&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_groups AS g ON g.courseid = c.id&lt;br /&gt;
JOIN prefix_groups_members AS m ON g.id = m.groupid&lt;br /&gt;
JOIN prefix_user AS u ON m.userid = u.id&lt;br /&gt;
WHERE c.id = #&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if you are using Configurable Reports block and want to perform this query on the current course you are in, then you can use a WHERE clause like this:&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
WHERE c.id = %%COURSEID%%&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Group Export===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
There&#039;s a [[Import_groups|group import]] function, but no export. Use this to give you a report with the proper column order and headings to export to a csv file you can then import into another course to replicate the groups. This is a simple version with just the main fields: groupname, description, enrolment key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT g.name AS groupname, g.description, g.enrolmentkey&lt;br /&gt;
FROM prefix_groups AS g &lt;br /&gt;
JOIN prefix_course as c ON g.courseid = c.id&lt;br /&gt;
WHERE c.id = #&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: if you are using Configurable Reports block and want to perform this query on the current course you are in, then you can use a WHERE clause like this:&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
WHERE c.id = %%COURSEID%%&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List all Courses in and below a certain category===&lt;br /&gt;
Use this SQL code to retrieve all courses that exist in or under a set category.&lt;br /&gt;
&lt;br /&gt;
$s should be the id of the category you want to know about...&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT prefix_course. * , prefix_course_categories. *&lt;br /&gt;
FROM prefix_course, prefix_course_categories&lt;br /&gt;
WHERE prefix_course.category = prefix_course_categories.id&lt;br /&gt;
AND (&lt;br /&gt;
prefix_course_categories.path LIKE &#039;%/$s/%&#039;&lt;br /&gt;
OR prefix_course_categories.path LIKE &#039;%/$s&#039;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List all Categories in one level below a certain category===&lt;br /&gt;
Use this PHP code to retrieve a list of all categories below a certain category.&lt;br /&gt;
&lt;br /&gt;
$s should be the id of the top level category you are interested in.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
require_once(&#039;./config.php&#039;);&lt;br /&gt;
&lt;br /&gt;
$parent_id = $s;&lt;br /&gt;
&lt;br /&gt;
$categories= array();&lt;br /&gt;
&lt;br /&gt;
$categories = get_categories($parent_id);&lt;br /&gt;
&lt;br /&gt;
echo &#039;&amp;lt;ol&amp;gt;&#039;;&lt;br /&gt;
foreach ($categories as $category)&lt;br /&gt;
        {&lt;br /&gt;
        echo &#039;&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;&#039;.$CFG-&amp;gt;wwwroot.&#039;/course/category.php?id=&#039;.$category-&amp;gt;id.&#039;&amp;quot;&amp;gt;&#039;.$category-&amp;gt;name.&#039;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039;;&lt;br /&gt;
        }&lt;br /&gt;
echo &#039;&amp;lt;/ol&amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blog activity per Course (not including VIEW)===&lt;br /&gt;
Filter activity logging to some specific Course Categories!&lt;br /&gt;
+ link course name to actual course (for quick reference)&lt;br /&gt;
(you can change %blog% to %wiki% to filter down all wiki activity or any other module you wish)&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,cm.course,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) as CourseID&lt;br /&gt;
,m.name ,count(cm.id) as counter &lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
) AS Students&lt;br /&gt;
, ( SELECT count(id) FROM prefix_log WHERE `module` LIKE &#039;%blog%&#039; AND course = c.id AND action NOT LIKE &#039;%view%&#039; ) as BlogActivity&lt;br /&gt;
FROM `prefix_course_modules` as cm JOIN prefix_modules as m ON cm.module=m.id JOIN prefix_course as c ON cm.course = c.id &lt;br /&gt;
WHERE m.name LIKE &#039;%blog%&#039; AND c.category IN ( 8,13,15)&lt;br /&gt;
GROUP BY cm.course,cm.module order by counter desc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Student&#039;s posts content in all course blogs (oublog)===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
b.name &lt;br /&gt;
,op.title&lt;br /&gt;
,op.message&lt;br /&gt;
,( SELECT CONCAT(u.firstname, &#039; &#039;,u.lastname) FROM prefix_user AS u WHERE u.id = oi.userid) AS &amp;quot;Username&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_oublog_posts AS op&lt;br /&gt;
JOIN prefix_oublog_instances AS oi ON oi.id = op.oubloginstancesid &lt;br /&gt;
JOIN prefix_oublog as b ON b.id = oi.oublogid&lt;br /&gt;
JOIN prefix_course AS c ON b.course = c.id&lt;br /&gt;
&lt;br /&gt;
WHERE c.id = %%COURSEID%%&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===All Courses which uploaded a Syllabus file===&lt;br /&gt;
+ under specific Category&lt;br /&gt;
+ show first Teacher in that course&lt;br /&gt;
+ link Course&#039;s fullname to actual course&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) as Course&lt;br /&gt;
,c.shortname,r.name&lt;br /&gt;
,(SELECT CONCAT(u.firstname,&#039; &#039;, u.lastname) as Teacher&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user as u ON u.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) as Teacher&lt;br /&gt;
FROM prefix_resource as r &lt;br /&gt;
JOIN prefix_course as c ON r.course = c.id&lt;br /&gt;
WHERE ( r.name LIKE &#039;%סילבוס%&#039; OR r.name LIKE &#039;%סילאבוס%&#039; OR r.name LIKE &#039;%syllabus%&#039; OR r.name LIKE &#039;%תכנית הקורס%&#039; ) &lt;br /&gt;
AND c.category IN (10,18,26,13,28)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
===Site-wide completed SCORM activities by Course name===&lt;br /&gt;
This report will list all completed attempts for all SCORM activities. It is ordered first by Course name, then student&#039;s last name, then student&#039;s first name, then attempt number. Please note: the FROM_UNIXTIME command is for MySQL.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.firstname First,u.lastname Last,c.fullname Course, st.attempt Attempt,st.value Status,FROM_UNIXTIME(st.timemodified,&amp;quot;%m-%d-%Y&amp;quot;) Date &lt;br /&gt;
FROM prefix_scorm_scoes_track AS st &lt;br /&gt;
JOIN prefix_user AS u ON st.userid=u.id&lt;br /&gt;
JOIN prefix_scorm AS sc ON sc.id=st.scormid&lt;br /&gt;
JOIN prefix_course AS c ON c.id=sc.course&lt;br /&gt;
WHERE st.value=&#039;completed&#039; &lt;br /&gt;
ORDER BY c.fullname, u.lastname,u.firstname, st.attempt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
===All users enrolled in a course without a role===&lt;br /&gt;
Identifies All users that are enrolled in a course but are not assigned a role.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
user.firstname AS Firstname,&lt;br /&gt;
user.lastname AS Lastname,&lt;br /&gt;
user.idnumber Employee_ID,&lt;br /&gt;
course.fullname AS Course&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS course &lt;br /&gt;
JOIN prefix_enrol AS en ON en.courseid = course.id&lt;br /&gt;
JOIN prefix_user_enrolments AS ue ON ue.enrolid = en.id&lt;br /&gt;
JOIN prefix_user as user ON user.id = ue.userid&lt;br /&gt;
&lt;br /&gt;
WHERE user.id NOT IN (&lt;br /&gt;
SELECT u.id&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_context AS ctx ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_role AS r ON r.id = ra.roleid&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE c.id=course.id&lt;br /&gt;
)&lt;br /&gt;
ORDER BY Course, Lastname, Firstname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List course resources accumulative file size and count===&lt;br /&gt;
This is the main (first) report, which has a link (alias) to a second report (the following on this page) which list each file in the course.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.id &amp;quot;CourseID&amp;quot;, context.id &amp;quot;ContextID&amp;quot;&lt;br /&gt;
,CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;, c.id, &#039;&amp;quot;&amp;gt;&#039;, c.fullname ,&#039;&amp;lt;/a&amp;gt;&#039;) AS &amp;quot;Course Name&amp;quot;&lt;br /&gt;
, COUNT(*) &amp;quot;Course Files&amp;quot; , ROUND( SUM( f.filesize ) /1048576 ) AS file_size_MB&lt;br /&gt;
,CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/blocks/configurable_reports/viewreport.php?alias=coursefiles&amp;amp;courseid=1&amp;amp;filter_courses=&#039;, c.id, &#039;&amp;quot;&amp;gt;List files&amp;lt;/a&amp;gt;&#039;) AS &amp;quot;List Files&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM mdl_files AS f&lt;br /&gt;
JOIN mdl_context AS context ON context.id = f.contextid&lt;br /&gt;
JOIN mdl_course AS c ON c.id = (&lt;br /&gt;
  SELECT instanceid&lt;br /&gt;
  FROM mdl_context&lt;br /&gt;
  WHERE id = SUBSTRING_INDEX( SUBSTRING_INDEX( context.path, &#039;/&#039; , -2 ) , &#039;/&#039;, 1 ) )&lt;br /&gt;
WHERE filesize &amp;gt;0&lt;br /&gt;
GROUP BY c.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this report, you will have to define &amp;quot;alias&amp;quot; report property to &amp;quot;coursefiles&amp;quot; for it to be able to be called from the above report.&lt;br /&gt;
And also setup (add) a FILTER_COURSES filter. &lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
id ,CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/pluginfile.php/&#039;, contextid, &#039;/&#039;, component, &#039;/&#039;, filearea, &#039;/&#039;, itemid, &#039;/&#039;, filename, &#039;&amp;quot;&amp;gt;&#039;, filename,&#039;&amp;lt;/a&amp;gt;&#039;) AS &amp;quot;File&amp;quot;&lt;br /&gt;
,filesize, mimetype ,author, license, timecreated, component, filearea, filepath&lt;br /&gt;
&lt;br /&gt;
FROM mdl_files AS f&lt;br /&gt;
WHERE filesize &amp;gt;0&lt;br /&gt;
            AND f.contextid&lt;br /&gt;
            IN (   SELECT id&lt;br /&gt;
                     FROM mdl_context&lt;br /&gt;
                    WHERE path &lt;br /&gt;
                     LIKE (   SELECT CONCAT(&#039;%/&#039;,id,&#039;/%&#039;)&lt;br /&gt;
                                  AS contextquery&lt;br /&gt;
                                FROM mdl_context&lt;br /&gt;
                               WHERE 1=1&lt;br /&gt;
			        %%FILTER_COURSES:instanceid%%&lt;br /&gt;
                                 AND contextlevel = 50&lt;br /&gt;
                           )&lt;br /&gt;
                )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Which courses has redundant topics===&lt;br /&gt;
This report list several &amp;quot;active topics&amp;quot; calculations, per course. which should give an administrator some indications for which topics/sections/weeks are filled with resources and activities and which ones are empty and not used (usually, at the end of the course).&lt;br /&gt;
&lt;br /&gt;
The following, second SQL query, could be used to &amp;quot;trim&amp;quot; down those redundant course topics/sections/weeks by updating the course format&#039;s numsection (Number of sections) setting. (It&#039;s a per course format setting!)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT id, format,&lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;, c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course &lt;br /&gt;
&lt;br /&gt;
,(SELECT value  FROM  `mdl_course_format_options` WHERE  `courseid` = c.id AND `format` = c.format AND `name` = &#039;numsections&#039; ) AS &amp;quot;numsections&amp;quot;&lt;br /&gt;
,(SELECT COUNT(*) FROM  `mdl_course_sections` WHERE  `course` = c.id AND `sequence` !=  &#039;&#039; ) AS &amp;quot;Non empty sections count&amp;quot;&lt;br /&gt;
,(SELECT COUNT(*) FROM  `mdl_course_sections` WHERE  `course` = c.id ) AS &amp;quot;Total section count&amp;quot;&lt;br /&gt;
,(SELECT COUNT(*) FROM  `mdl_course_sections` WHERE  `course` = c.id AND sequence IS NOT NULL) AS &amp;quot;Non NULL sections count&amp;quot;&lt;br /&gt;
,(SELECT COUNT(*) FROM  `mdl_course_sections` WHERE  `course` = c.id AND name != &#039;&#039;) AS &amp;quot;Non empty section Name count&amp;quot;&lt;br /&gt;
 ,(SELECT COUNT(*) FROM mdl_course_modules cm WHERE cm.course = c.id) &amp;quot;Modules count&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM mdl_course AS c&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following SQL REPLACE query is used for &amp;quot;fixing&amp;quot; (updating) the &amp;quot;numsections&amp;quot; of a specific course format &amp;quot;onetopics&amp;quot; (you can always change it, or discard it to use this SQL REPLACE on all course formats) &lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
REPLACE INTO `mdl_course_format_options` (`id`, `courseid`, `format`, `sectionid`, `name`, `value`) &lt;br /&gt;
SELECT NULL, c.id, &#039;onetopic&#039;, &#039;0&#039;, &#039;numsections&#039;, (SELECT COUNT(*) FROM `mdl_course_sections` WHERE `course` = c.id AND name != &#039;&#039;)&lt;br /&gt;
FROM `mdl_course` c where format = &#039;onetopic&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hidden Courses with Students Enrolled===&lt;br /&gt;
Contributed by Eric Strom&lt;br /&gt;
&lt;br /&gt;
This query identifies courses with student enrollment that are currently hidden from students. Includes the defined course start date, count of students and instructors, and a clickable email link of instructor (first found record if more than one).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.visible AS Visible, &lt;br /&gt;
DATE(FROM_UNIXTIME(c.startdate)) AS StartDate, &lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php&#039;,CHAR(63),&#039;id=&#039;,&lt;br /&gt;
c.id,&#039;&amp;quot;&amp;gt;&#039;,c.idnumber,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course_ID,&lt;br /&gt;
&lt;br /&gt;
(SELECT COUNT( ra.userid ) FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5 AND ctx.instanceid = c.id) AS Students,&lt;br /&gt;
&lt;br /&gt;
(SELECT COUNT( ra.userid ) FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id) AS Instructors,&lt;br /&gt;
&lt;br /&gt;
(SELECT DISTINCT concat(&#039;&amp;lt;a href=&amp;quot;mailto:&#039;,u.email,&#039;&amp;quot;&amp;gt;&#039;,u.email,&#039;&amp;lt;/a&amp;gt;&#039;)&lt;br /&gt;
  FROM prefix_role_assignments AS ra&lt;br /&gt;
  JOIN prefix_user AS u ON ra.userid = u.id&lt;br /&gt;
  JOIN prefix_context AS ctx ON ctx.id = ra.contextid&lt;br /&gt;
  WHERE ra.roleid = 3 AND ctx.instanceid = c.id AND ctx.contextlevel = 50 LIMIT 1) AS &#039;Instructor_Email&#039;, &lt;br /&gt;
&lt;br /&gt;
now() AS Report_Timestamp&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c &lt;br /&gt;
WHERE c.visible = 0 AND (SELECT COUNT( ra.userid ) FROM prefix_role_assignments AS ra JOIN prefix_context AS ctx ON ra.contextid = ctx.id WHERE ra.roleid = 5 AND ctx.instanceid = c.id) &amp;gt; 0&lt;br /&gt;
ORDER BY StartDate, Instructor_Email, Course_ID&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Course Design Reports==&lt;br /&gt;
&lt;br /&gt;
These are reports which summarize course design aspects, such as activity and resource modules per section, types of activities used, etc.&lt;br /&gt;
&lt;br /&gt;
===Course Content/Week===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College&lt;br /&gt;
&lt;br /&gt;
This report assumes that the first 14 sections in a course, not including the &amp;quot;0&amp;quot; or &amp;quot;Welcome&amp;quot; section, correspond to weeks (with &amp;quot;Subsections&amp;quot; given numbers much higher in the sequence). Of those sections, each is checked to count the number of:&lt;br /&gt;
&lt;br /&gt;
    Forums&lt;br /&gt;
    Graded Activities (may include Forums)&lt;br /&gt;
    Resources (not including a Label)&lt;br /&gt;
&lt;br /&gt;
Totals of each of these types of content elements per section are provided.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only visible resources and activities are counted.&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: this is a &amp;quot;Global&amp;quot; report. Run it within a course to see a summary of the contents of that course.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
 &lt;br /&gt;
cs.section AS &#039;Week&#039;&lt;br /&gt;
, cs.name AS &#039;Section Name&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF((gi.id IS NULL) AND (m.name NOT LIKE &#039;label&#039;),cm.id,NULL)) AS &#039;Ungraded Resources&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF(m.name LIKE &#039;forum&#039;, cm.id, NULL)) AS &#039;Forums&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF(gi.id, cm.id, NULL)) AS &#039;Graded Activities&#039;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_course_sections AS cs ON cs.course = c.id AND cs.section &amp;lt;= 14 AND cs.section &amp;gt; 0&lt;br /&gt;
LEFT JOIN prefix_course_modules AS cm ON cm.course = c.id AND cm.section = cs.id &lt;br /&gt;
JOIN prefix_modules AS m ON m.id = cm.module&lt;br /&gt;
LEFT JOIN prefix_grade_items AS gi ON gi.courseid = c.id AND gi.itemmodule = m.name AND gi.iteminstance = cm.instance&lt;br /&gt;
&lt;br /&gt;
WHERE &lt;br /&gt;
cs.visible = 1&lt;br /&gt;
AND cm.visible = 1&lt;br /&gt;
AND c.id = %%COURSEID%%&lt;br /&gt;
&lt;br /&gt;
GROUP BY cs.section&lt;br /&gt;
ORDER BY cs.section&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Assignments and Weights===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College&lt;br /&gt;
&lt;br /&gt;
Returns a list of grade book categories for the current course, grade book weightings, the first type of assignment included in the category, a count of different assignment types for each category, and a count of assignments for each category.&lt;br /&gt;
&lt;br /&gt;
Categories with weights of 0 are not included in this report.&lt;br /&gt;
&lt;br /&gt;
Only visible activities are included in this report.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This is designed to be a &amp;quot;Global&amp;quot; report in Configurable Reports.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;br /&gt;
IF(gc.parent IS NOT NULL, gc.fullname, &#039;None&#039;) AS &#039;Grade Book Category&#039;&lt;br /&gt;
, IF(gc.parent IS NOT NULL, ROUND(gic.aggregationcoef, 2), ROUND(SUM(DISTINCT gi.aggregationcoef), 2)+ROUND(SUM(DISTINCT mgi.aggregationcoef), 2)) AS &#039;Category weight&#039;&lt;br /&gt;
&lt;br /&gt;
, CONCAT_WS(&#039;, &#039;,GROUP_CONCAT(DISTINCT gi.itemmodule SEPARATOR &#039;, &#039;), IF(mgi.id, &#039;manual&#039;,NULL)) AS &#039;Activity Types&#039;&lt;br /&gt;
, COUNT(DISTINCT gi.itemmodule) + IF(mgi.id,1,0) AS &#039;Different Activity Types&#039;&lt;br /&gt;
, CONCAT_WS(&#039;&amp;lt;br&amp;gt;&#039;, GROUP_CONCAT(DISTINCT gi.itemname ORDER BY gi.itemname SEPARATOR &#039;&amp;lt;br&amp;gt;&#039;), GROUP_CONCAT(DISTINCT mgi.itemname ORDER BY mgi.itemname SEPARATOR &#039;&amp;lt;br&amp;gt;&#039;)) AS &#039;Activity Names&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(gi.id, cm.id, NULL)) + COUNT(DISTINCT mgi.id) AS &#039;Activity Count&#039;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
&lt;br /&gt;
#get grade categories&lt;br /&gt;
LEFT JOIN prefix_grade_categories AS gc ON gc.courseid = c.id &lt;br /&gt;
# back from categories to grade items to get aggregations and weights&lt;br /&gt;
JOIN prefix_grade_items AS gic ON gic.courseid = c.id AND gic.itemtype = &#039;category&#039; AND gic.aggregationcoef != 0 AND (LOCATE(gic.iteminstance, gc.path) OR (gc.parent IS NULL))&lt;br /&gt;
&lt;br /&gt;
# attach activities to course&lt;br /&gt;
JOIN prefix_course_modules AS cm ON cm.course = c.id &lt;br /&gt;
# attach grade items to activities&lt;br /&gt;
LEFT JOIN prefix_grade_items AS gi ON gi.courseid = c.id AND gi.iteminstance = cm.instance AND gi.itemtype = &#039;mod&#039; AND gi.categoryid = gc.id AND gi.hidden != 1&lt;br /&gt;
&lt;br /&gt;
# attach manual grade items to course-- they don&#039;t have modules&lt;br /&gt;
LEFT JOIN prefix_grade_items AS mgi ON mgi.courseid = c.id and mgi.itemtype = &#039;manual&#039; AND mgi.categoryid = gc.id&lt;br /&gt;
&lt;br /&gt;
WHERE &lt;br /&gt;
cm.visible = 1&lt;br /&gt;
AND c.id = %%COURSEID%%&lt;br /&gt;
&lt;br /&gt;
GROUP BY gc.id&lt;br /&gt;
ORDER BY gc.id&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pre-Term Course Review===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College&lt;br /&gt;
&lt;br /&gt;
Provides an overview of the readiness of ONLINE, HYBRID, and BLENDED courses in the Staging category and all subcategories. Links to each course are provided. Other details:&lt;br /&gt;
&lt;br /&gt;
#   &amp;quot;Required blocks&amp;quot; include Instructor Block (mooprofile), Activities, and the Research block.&lt;br /&gt;
#    &amp;quot;Instructor Details&amp;quot; block is not the &amp;quot;Instructor&amp;quot; block (mooprofile) automatically provided by the system. It is an optional block that can be edited by the instructor. If not edited to remove boilerplate text, it should be hidden.&lt;br /&gt;
#    All courses should be in the &amp;quot;Collapsed Topics&amp;quot; format with the &amp;quot;Weeks&amp;quot; structure.&lt;br /&gt;
#    &amp;quot;Weeks defined in course settings&amp;quot; is taken from our SIS when the course shells are created, but can be edited by faculty. &amp;quot;# of weeks named and visible&amp;quot; should usually match or exceed this value.&lt;br /&gt;
#    We recommend that each week contain at least one forum, at least one graded activity, and at least one ungraded resource.&lt;br /&gt;
#    &amp;quot;Syllabus updated&amp;quot; date is for the first attached file found with the text &amp;quot;syllabus&amp;quot; in the name. The &amp;quot;Days ago&amp;quot; calculation is included for convenience.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: At our institution, we construct categories each term, and insert a text string &amp;quot;staging&amp;quot; in the Category ID for pre-term courses during the preparation or &amp;quot;staging&amp;quot; phase of course development. We remove this text string (and change it to &amp;quot;production&amp;quot;) when courses go live at the start of the new term.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php&#039;,CHAR(63),&#039;id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.shortname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
&lt;br /&gt;
#,RIGHT(c.idnumber,2) AS Type # Specific to GSC &amp;quot;Instructional Method&amp;quot; storage&lt;br /&gt;
&lt;br /&gt;
#, substring_index(substr(c.shortname FROM locate(&#039;.&#039;,c.shortname)+1),&#039;-&#039;,1) AS Section # Specific to GSC&lt;br /&gt;
 &lt;br /&gt;
,(SELECT CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/user/view.php&#039;,CHAR(63),&#039;id=&#039;,u.id,&#039;&amp;quot;&amp;gt;&#039;,u.lastname,&#039;, &#039;, u.firstname,&#039;&amp;lt;/a&amp;gt;&#039;)&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) AS &#039;Instructor&#039; &lt;br /&gt;
&lt;br /&gt;
,(SELECT IF((u2.description IS NULL) OR (u2.description LIKE &#039;&#039;),&#039;NO&#039;, &#039;YES&#039;)&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u2 ON u2.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) AS &#039;Profile Has Bio&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT IF(u3.picture &amp;gt; 0,&#039;YES&#039;,&#039;NO&#039;)&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u3 ON u3.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) AS &#039;Profile Has Picture&#039;&lt;br /&gt;
&lt;br /&gt;
, IF(((bpi.visible IS NULL) OR (bpi.visible !=0)) AND ((bpm.visible IS NULL) OR (bpm.visible !=0)) AND ((bpa.visible IS NULL) OR (bpa.visible !=0)) AND ((bpr.visible IS NULL) OR (bpr.visible !=0)),&#039;YES&#039;,&#039;NO&#039;) AS &#039;Required blocks visible&#039;&lt;br /&gt;
#, IF((bpm.visible IS NULL) OR (bpm.visible !=0),&#039;YES&#039;,&#039;NO&#039;) AS &#039;Messages block visible&#039;&lt;br /&gt;
#, IF((bpa.visible IS NULL) OR (bpa.visible !=0),&#039;YES&#039;,&#039;NO&#039;) AS &#039;activities block visible&#039;&lt;br /&gt;
#, IF((bpr.visible IS NULL) OR (bpr.visible !=0),&#039;YES&#039;,&#039;NO&#039;) AS &#039;research block visible&#039;&lt;br /&gt;
&lt;br /&gt;
#, IF(SUM(IF(bi.configdata LIKE &#039;Tzo4OiJzdGRDbGFzcyI6Mzp7czo1OiJ0aXRsZSI7czoxODoiSW5zdHJ1Y3RvciBEZXRhaWxzI%&#039;,1,0)) AND (bip.visible !=0),&#039;YES&#039;,&#039;&#039;) AS &#039;Instructor Details Block visible&#039; # This is a hack based on UUencoded string data from the title of HTML &amp;quot;Instructor Details&amp;quot; block&lt;br /&gt;
&lt;br /&gt;
#, IF(bi.configdata LIKE &#039;%ZGl0IHRoaXMgYmxvY2s%&#039;,&#039;NO&#039;,&#039;&#039;) AS &#039;Instructor Details Block Updated&#039; # HTML block has string &#039;dit this block&#039;&lt;br /&gt;
&lt;br /&gt;
#, IF(COUNT(bi.id) -  SUM(IF(bi.configdata LIKE &#039;Tzo4OiJzdGRDbGFzcyI6Mzp7czo1OiJ0aXRsZSI7czoxODoiSW5zdHJ1Y3RvciBEZXRhaWxzI%&#039;,1,0)),&#039;YES&#039;,&#039;&#039;) AS &#039;possible extra instructor blocks&#039; #looking for any HTML block with &amp;quot;instructor&amp;quot; in the title&lt;br /&gt;
&lt;br /&gt;
, IF(c.format=&#039;topcoll&#039;,&#039;YES&#039;, c.format) AS &#039;Collapsed Topics course format&#039; # change this if you want to test for a different format&lt;br /&gt;
, IF(cfo.value = 2, &#039;YES&#039;,&#039;NO&#039;) AS &#039;weeks structure&#039;&lt;br /&gt;
&lt;br /&gt;
, cfw.value AS &#039;weeks defined in course settings&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF(((cs.name IS NOT NULL) AND (cs.visible = 1) AND (cs.section != &#039;0&#039;) AND (cs.sequence IS NOT NULL)),cs.id,NULL)) AS &#039;# of weeks named &amp;amp; visible (includes orphans)&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF(m.name LIKE &#039;forum&#039;, cm.id, NULL)) AS &#039;Forums&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(m.name LIKE &#039;forum&#039; ,cs.id , NULL)) AS &#039;Weeks with Forum&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF(gi.id, cm.id, NULL)) AS &#039;Activities&#039;&lt;br /&gt;
, COUNT(DISTINCT IF(gi.id, cs.id, NULL)) AS &#039;Weeks with Activities&#039;&lt;br /&gt;
, COUNT(DISTINCT mgi.id) AS &#039;Manual Grade Items&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT(DISTINCT IF((gi.id IS NULL) AND (m.name NOT IN (&#039;forum&#039;,&#039;label&#039;)),cm.id,NULL)) AS &#039;Resources&#039;&lt;br /&gt;
, COUNT(DISTINCT IF((gi.id IS NULL) AND (m.name NOT IN (&#039;forum&#039;,&#039;label&#039;)), cs.id, NULL)) AS &#039;Weeks with Resources&#039;&lt;br /&gt;
&lt;br /&gt;
# Here are some other things you could check for per course&lt;br /&gt;
#,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm JOIN prefix_modules AS m ON cm.module = m.id WHERE cm.course = c.id AND m.name LIKE &#039;%forum%&#039;) AS Forums&lt;br /&gt;
 &lt;br /&gt;
#,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm JOIN prefix_modules AS m ON cm.module = m.id WHERE cm.course = c.id AND m.name LIKE &#039;%quiz%&#039;) AS Quizzes&lt;br /&gt;
 &lt;br /&gt;
#,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm JOIN prefix_modules AS m ON cm.module = m.id WHERE cm.course = c.id AND m.name LIKE &#039;%assign%&#039;) AS Assignments&lt;br /&gt;
&lt;br /&gt;
#,(SELECT COUNT(prefix_resource.id) FROM prefix_resource JOIN prefix_course ON prefix_course.id = prefix_resource.course WHERE c.id = prefix_resource.course) AS Files&lt;br /&gt;
&lt;br /&gt;
#,(SELECT COUNT(prefix_url.id) FROM prefix_url JOIN prefix_course ON prefix_course.id = prefix_url.course WHERE c.id = prefix_url.course) AS Links&lt;br /&gt;
&lt;br /&gt;
,(SELECT FROM_UNIXTIME(MAX(prefix_resource.timemodified))&lt;br /&gt;
FROM prefix_resource&lt;br /&gt;
JOIN prefix_course ON prefix_course.id = prefix_resource.course WHERE c.id = prefix_resource.course AND prefix_resource.name LIKE &#039;%syllabus%&#039;) AS SyllabusDate&lt;br /&gt;
&lt;br /&gt;
,(SELECT TO_DAYS(NOW())-TO_DAYS(FROM_UNIXTIME(MAX(prefix_resource.timemodified)))&lt;br /&gt;
FROM prefix_resource&lt;br /&gt;
JOIN prefix_course ON prefix_course.id = prefix_resource.course WHERE c.id = prefix_resource.course AND prefix_resource.name LIKE &#039;%syllabus%&#039;) AS DaysAgo&lt;br /&gt;
&lt;br /&gt;
, IF(COUNT(DISTINCT IF(f.type LIKE &#039;news&#039;, f.id,NULL)),&#039;YES&#039;,&#039;NO&#039; ) AS &#039;Announcement Forum Visible&#039;&lt;br /&gt;
&lt;br /&gt;
, IF(COUNT(DISTINCT IF(f.type LIKE &#039;news&#039;, fd.id,NULL)),&#039;YES&#039;,&#039;NO&#039; ) AS &#039;Announcement posted&#039;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
LEFT JOIN prefix_course_categories as cc ON c.category = cc.id&lt;br /&gt;
LEFT JOIN prefix_context AS ctxx ON c.id = ctxx.instanceid &lt;br /&gt;
&lt;br /&gt;
LEFT JOIN prefix_block_positions AS bpi ON bpi.contextid = ctxx.id AND bpi.blockinstanceid = &#039;43692&#039; # mooprofile&lt;br /&gt;
LEFT JOIN prefix_block_positions AS bpm ON bpm.contextid = ctxx.id AND bpm.blockinstanceid = &#039;43962&#039; # messages&lt;br /&gt;
LEFT JOIN prefix_block_positions AS bpa ON bpa.contextid = ctxx.id AND bpa.blockinstanceid = &#039;43963&#039; # activities&lt;br /&gt;
LEFT JOIN prefix_block_positions AS bpr ON bpr.contextid = ctxx.id AND bpr.blockinstanceid = &#039;38368&#039; # html research help&lt;br /&gt;
&lt;br /&gt;
LEFT JOIN prefix_course_sections AS cs ON cs.course = c.id AND cs.visible = 1 AND cs.sequence IS NOT NULL&lt;br /&gt;
LEFT JOIN prefix_course_modules AS cm ON cm.course = c.id AND cm.section = cs.id &lt;br /&gt;
LEFT JOIN prefix_modules AS m ON m.id = cm.module&lt;br /&gt;
LEFT JOIN prefix_grade_items AS gi ON gi.courseid = c.id AND gi.itemmodule = m.name AND gi.iteminstance = cm.instance&lt;br /&gt;
&lt;br /&gt;
LEFT JOIN prefix_forum AS f ON f.course = c.id AND cm.instance = f.id AND cm.visible = 1&lt;br /&gt;
LEFT JOIN prefix_forum_discussions AS fd ON fd.forum = f.id&lt;br /&gt;
&lt;br /&gt;
# attach manual grade items to course-- they don&#039;t have modules&lt;br /&gt;
LEFT JOIN prefix_grade_items AS mgi ON mgi.courseid = c.id and mgi.itemtype = &#039;manual&#039;&lt;br /&gt;
&lt;br /&gt;
LEFT JOIN prefix_course_format_options AS cfo ON cfo.courseid = c.id AND cfo.name = &#039;layoutstructure&#039;&lt;br /&gt;
LEFT JOIN prefix_course_format_options AS cfw ON cfw.courseid = c.id AND cfw.name = &#039;numsections&#039;&lt;br /&gt;
&lt;br /&gt;
LEFT JOIN prefix_block_instances AS bi ON bi.parentcontextid = ctxx.id AND bi.blockname = &#039;html&#039; AND (bi.configdata LIKE &#039;%SW5zdHJ1Y3Rvc%&#039; or bi.configdata LIKE &#039;%bnN0cnVjdG9y%&#039;)&lt;br /&gt;
LEFT JOIN prefix_block_positions AS bip ON bip.blockinstanceid = bi.id&lt;br /&gt;
&lt;br /&gt;
WHERE RIGHT(c.idnumber,2) IN (&#039;OL&#039;, &#039;BL&#039;, &#039;HY&#039;) &lt;br /&gt;
# AND substring(cc.path,2,2) IN (&#039;26&#039;) # Staging&lt;br /&gt;
#AND substring(cc.path,2,3) IN (&#039;158&#039;) # UG&lt;br /&gt;
AND cc.idnumber LIKE &#039;%staging%&#039;&lt;br /&gt;
AND ctxx.contextlevel = 50&lt;br /&gt;
&lt;br /&gt;
GROUP BY c.shortname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Module instances + Module HITs by role teacher and student in course===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
m.name AS &amp;quot;Module name&amp;quot;&lt;br /&gt;
, COUNT(*) AS &amp;quot;Module count&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_log AS l &lt;br /&gt;
WHERE l.course = cm.course AND l.module = m.name ) AS &amp;quot;Hits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*)&lt;br /&gt;
FROM prefix_log AS l&lt;br /&gt;
JOIN prefix_context AS con ON con.instanceid= l.course AND con.contextlevel=50&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid= con.id AND ra.userid= l.userid AND ra.roleid = 5 &lt;br /&gt;
WHERE l.course = cm.course AND l.module = m.name) AS &amp;quot;Students HITs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*)&lt;br /&gt;
FROM prefix_log AS l&lt;br /&gt;
JOIN prefix_context AS con ON con.instanceid= l.course AND con.contextlevel=50&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid= con.id AND ra.userid= l.userid AND ra.roleid = 3 &lt;br /&gt;
WHERE l.course = cm.course AND l.module = m.name) AS &amp;quot;Teachers HITs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM mdl_course_modules AS cm&lt;br /&gt;
JOIN mdl_modules AS m on m.id = cm.module&lt;br /&gt;
WHERE cm.course = &#039;%%COURSEID%%&#039;&lt;br /&gt;
GROUP BY cm.module&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Course Syllabus===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College / Moodle HQ&lt;br /&gt;
&lt;br /&gt;
This report requires ELIS. It runs from within a course and constructs a course syllabus based on content in the course and in the ELIS entries related to the course (Class Instance, Course Description, and Program). It is a proof-of-concept of an automated syllabus production tool. Fields such as &amp;quot;Course Policies&amp;quot; and &amp;quot;Teaching Philosophy&amp;quot; are added to the Class Instance records, and instructors enter them there. The Instructor Bio is pulled from the User Profile of all users with the Teacher role in the course.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
&lt;br /&gt;
c.fullname AS &#039;fullname&#039;&lt;br /&gt;
, ec.idnumber AS &#039;elis-id&#039;&lt;br /&gt;
, DATE_FORMAT(FROM_UNIXTIME(ec.startdate), &#039;%b %e, %Y&#039;) AS &#039;start&#039;&lt;br /&gt;
, DATE_FORMAT(FROM_UNIXTIME(ec.enddate), &#039;%b %e, %Y&#039;) AS &#039;end&#039;&lt;br /&gt;
, ecd.name AS &#039;longname&#039;&lt;br /&gt;
, ecd.code AS &#039;coursecode&#039;&lt;br /&gt;
, ecd.credits AS &#039;coursecredits&#039;&lt;br /&gt;
, ecd.syllabus AS &#039;description&#039;&lt;br /&gt;
&lt;br /&gt;
, (SELECT  eft.data&lt;br /&gt;
FROM prefix_local_eliscore_fld_data_text AS eft&lt;br /&gt;
JOIN prefix_local_eliscore_field AS ef ON ef.id = eft.fieldid AND ef.shortname = &#039;learning-outcomes&#039;&lt;br /&gt;
WHERE ctxecd.id = eft.contextid) AS &#039;outcomes&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/user/view.php&#039;,CHAR(63),&#039;id=&#039;,u.id,&#039;&amp;quot;&amp;gt;&#039;,u.firstname,&#039; &#039;, u.lastname,&#039;&amp;lt;/a&amp;gt; &#039;, u.email)&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) AS &#039;Instructor&#039; &lt;br /&gt;
&lt;br /&gt;
, (SELECT  efc.data&lt;br /&gt;
FROM prefix_local_eliscore_fld_data_char AS efc&lt;br /&gt;
JOIN prefix_local_eliscore_field AS ef ON ef.id = efc.fieldid AND ef.shortname = &#039;term-code&#039;&lt;br /&gt;
WHERE ctxci.id = efc.contextid) AS &#039;termcode&#039;&lt;br /&gt;
&lt;br /&gt;
, (SELECT  eft.data&lt;br /&gt;
FROM prefix_local_eliscore_fld_data_text AS eft&lt;br /&gt;
JOIN prefix_local_eliscore_field AS ef ON ef.id = eft.fieldid AND ef.shortname = &#039;prerequisites&#039;&lt;br /&gt;
WHERE ctxecd.id = eft.contextid) AS &#039;prerequisites&#039;&lt;br /&gt;
&lt;br /&gt;
, (SELECT  eft.data&lt;br /&gt;
FROM prefix_local_eliscore_fld_data_text AS eft&lt;br /&gt;
JOIN prefix_local_eliscore_field AS ef ON ef.id = eft.fieldid AND ef.shortname = &#039;textbooks&#039;&lt;br /&gt;
WHERE ctxci.id = eft.contextid) AS &#039;textbooks&#039;&lt;br /&gt;
&lt;br /&gt;
, (SELECT  eft.data&lt;br /&gt;
FROM prefix_local_eliscore_fld_data_text AS eft&lt;br /&gt;
JOIN prefix_local_eliscore_field AS ef ON ef.id = eft.fieldid AND ef.shortname = &#039;other-class-materials&#039;&lt;br /&gt;
WHERE ctxci.id = eft.contextid) AS &#039;other-class-materials&#039;&lt;br /&gt;
&lt;br /&gt;
, (SELECT  eft.data&lt;br /&gt;
FROM prefix_local_eliscore_fld_data_text AS eft&lt;br /&gt;
JOIN prefix_local_eliscore_field AS ef ON ef.id = eft.fieldid AND ef.shortname = &#039;course-policies&#039;&lt;br /&gt;
WHERE ctxci.id = eft.contextid) AS &#039;course-policies&#039;&lt;br /&gt;
&lt;br /&gt;
, (SELECT  eft.data&lt;br /&gt;
FROM prefix_local_eliscore_fld_data_text AS eft&lt;br /&gt;
JOIN prefix_local_eliscore_field AS ef ON ef.id = eft.fieldid AND ef.shortname = &#039;teaching-philosophy&#039;&lt;br /&gt;
WHERE ctxci.id = eft.contextid) AS &#039;teaching-philosophy&#039;&lt;br /&gt;
&lt;br /&gt;
, (SELECT  eft.data&lt;br /&gt;
FROM prefix_local_eliscore_fld_data_text AS eft&lt;br /&gt;
JOIN prefix_local_eliscore_field AS ef ON ef.id = eft.fieldid AND ef.shortname = &#039;course-methods&#039;&lt;br /&gt;
WHERE ctxci.id = eft.contextid) AS &#039;course-methods&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT u2.description&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u2 ON u2.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) AS &#039;Bio&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT&lt;br /&gt;
&lt;br /&gt;
GROUP_CONCAT(DISTINCT CONCAT(&lt;br /&gt;
&lt;br /&gt;
&#039;&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;border: solid #000 .5px&amp;quot;&amp;gt;&#039;,IF(gc.parent IS NOT NULL, gc.fullname, &#039;None&#039;)&lt;br /&gt;
, &#039; &amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;border: solid #000 .5px&amp;quot;&amp;gt; &#039;&lt;br /&gt;
,IF(gc.parent IS NOT NULL, ROUND(gic.aggregationcoef, 2), ROUND( gi.aggregationcoef, 2)+ROUND(mgi.aggregationcoef, 2))&lt;br /&gt;
&lt;br /&gt;
) SEPARATOR &#039;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&#039;)&lt;br /&gt;
#get grade categories&lt;br /&gt;
FROM prefix_grade_categories AS gc &lt;br /&gt;
# back from categories to grade items to get aggregations and weights&lt;br /&gt;
LEFT JOIN prefix_grade_items AS gic ON gic.courseid = gc.courseid AND gic.itemtype = &#039;category&#039; AND gic.aggregationcoef != 0 AND (LOCATE(gic.iteminstance, gc.path) OR (gc.parent IS NULL))&lt;br /&gt;
# attach grade items to activities&lt;br /&gt;
LEFT JOIN prefix_grade_items AS gi ON gi.courseid = gc.courseid  AND gi.itemtype = &#039;mod&#039; AND gi.categoryid = gc.id AND gi.hidden != 1&lt;br /&gt;
# attach manual grade items to course-- they don&#039;t have modules&lt;br /&gt;
LEFT JOIN prefix_grade_items AS mgi ON mgi.courseid = gc.courseid and mgi.itemtype = &#039;manual&#039; AND mgi.categoryid = gc.id&lt;br /&gt;
WHERE gc.courseid = c.id  ) AS &#039;grade categories&#039;&lt;br /&gt;
&lt;br /&gt;
, &#039;&amp;lt;table width = &amp;quot;50%&amp;quot; &amp;gt;&#039; AS &#039;table start&#039;&lt;br /&gt;
, &#039;&amp;lt;table width = &amp;quot;100%&amp;quot; &amp;gt;&#039; AS &#039;table start 2&#039;&lt;br /&gt;
, &#039;&amp;lt;/table&amp;gt;&#039; AS &#039;table end&#039;&lt;br /&gt;
&lt;br /&gt;
, (SELECT  eft.data&lt;br /&gt;
FROM prefix_local_eliscore_fld_data_text AS eft&lt;br /&gt;
JOIN prefix_local_eliscore_field AS ef ON ef.id = eft.fieldid AND ef.shortname = &#039;activities-schedule&#039;&lt;br /&gt;
WHERE ctxci.id = eft.contextid) AS &#039;activities&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
, (SELECT  eft.data&lt;br /&gt;
FROM prefix_local_eliscore_fld_data_text AS eft&lt;br /&gt;
JOIN prefix_local_eliscore_field AS ef ON ef.id = eft.fieldid AND ef.shortname = &#039;schedule&#039;&lt;br /&gt;
WHERE ctxci.id = eft.contextid) AS &#039;schedule&#039;&lt;br /&gt;
&lt;br /&gt;
, (SELECT  eft.data&lt;br /&gt;
FROM prefix_local_eliscore_fld_data_text AS eft&lt;br /&gt;
JOIN prefix_local_eliscore_field AS ef ON ef.id = eft.fieldid AND ef.shortname = &#039;grading-scale&#039;&lt;br /&gt;
WHERE ctxepm.id = eft.contextid) AS &#039;gradescale&#039;&lt;br /&gt;
&lt;br /&gt;
FROM&lt;br /&gt;
prefix_course AS c &lt;br /&gt;
&lt;br /&gt;
# connect moodle course to ELIS class instance&lt;br /&gt;
LEFT JOIN prefix_local_elisprogram_cls_mdl AS ecm ON ecm.moodlecourseid = c.id&lt;br /&gt;
LEFT JOIN prefix_local_elisprogram_cls AS ec ON ec.id = ecm.classid&lt;br /&gt;
# class instance context&lt;br /&gt;
LEFT JOIN prefix_context AS ctxci ON ctxci.instanceid = ec.id AND ctxci.contextlevel = &#039;14&#039;&lt;br /&gt;
&lt;br /&gt;
# connect ELIS class instance to ELIS course description&lt;br /&gt;
LEFT JOIN prefix_local_elisprogram_crs AS ecd ON ecd.id = ec.courseid&lt;br /&gt;
# course description context&lt;br /&gt;
LEFT JOIN prefix_context AS ctxecd ON ctxecd.instanceid = ecd.id AND ctxecd.contextlevel = &#039;13&#039;&lt;br /&gt;
&lt;br /&gt;
#connect ELIS program to ELIS Course Description&lt;br /&gt;
LEFT JOIN prefix_local_elisprogram_pgm_crs AS epc ON epc.courseid = ecd.id&lt;br /&gt;
LEFT JOIN prefix_local_elisprogram_pgm AS epm ON epm.id = epc.curriculumid&lt;br /&gt;
# course program context&lt;br /&gt;
LEFT JOIN prefix_context AS ctxepm ON ctxepm.instanceid = epm.id AND ctxepm.contextlevel = &#039;11&#039;&lt;br /&gt;
&lt;br /&gt;
WHERE&lt;br /&gt;
&lt;br /&gt;
c.id = %%COURSEID%%&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Course Activities Helper===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College&lt;br /&gt;
&lt;br /&gt;
This report provides a list of the graded activities in a course.&lt;br /&gt;
* &#039;&#039;&#039;Note&#039;&#039;&#039;: Only graded activities are displayed.&lt;br /&gt;
* &#039;&#039;&#039;Note&#039;&#039;&#039;: This is a &amp;quot;Global&amp;quot; report. Run it within a course to see a summary of the contents of that course.&lt;br /&gt;
* &#039;&#039;&#039;Note&#039;&#039;&#039;: This report assumes that course sections each last one week.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
# 303 Course Activities Helper&lt;br /&gt;
&lt;br /&gt;
SELECT &lt;br /&gt;
&lt;br /&gt;
gi.itemmodule AS &#039;activity type&#039;&lt;br /&gt;
# cs.section AS &#039;section number&#039;&lt;br /&gt;
&lt;br /&gt;
# Calculation assumes each section lasts one week&lt;br /&gt;
, CONCAT(DATE_FORMAT(FROM_UNIXTIME(c.startdate + (7*24*60*60* (cs.section-1))), &#039;%b %e, %Y&#039;),&#039; - &amp;lt;br&amp;gt;&#039;,DATE_FORMAT(FROM_UNIXTIME(c.startdate + (7*24*60*60* (cs.section))), &#039;%b %e, %Y&#039;)) AS &#039;Date&#039;&lt;br /&gt;
&lt;br /&gt;
, gi.itemname AS &#039;activity name&#039;&lt;br /&gt;
&lt;br /&gt;
#, (SELECT asg.intro FROM prefix_assign AS asg WHERE asg.id = cm.instance) AS &#039;intro&#039;&lt;br /&gt;
&lt;br /&gt;
#, (SELECT f.intro FROM prefix_forum AS f WHERE f.id = cm.instance) AS &#039;f intro&#039;&lt;br /&gt;
&lt;br /&gt;
, CASE gi.itemmodule &lt;br /&gt;
WHEN &#039;assign&#039; THEN (SELECT asg.intro FROM prefix_assign AS asg WHERE asg.id = gi.iteminstance) &lt;br /&gt;
WHEN &#039;forum&#039; THEN (SELECT f.intro FROM prefix_forum AS f WHERE f.id = gi.iteminstance) &lt;br /&gt;
WHEN &#039;quiz&#039; THEN (SELECT q.intro FROM prefix_quiz AS q WHERE q.id = gi.iteminstance) &lt;br /&gt;
END AS &#039;test case&#039;&lt;br /&gt;
&lt;br /&gt;
#, (SELECT GROUP_CONCAT(CONCAT(&#039; - &#039;,gi.itemname) SEPARATOR &#039;&amp;lt;BR&amp;gt;&#039;) FROM  prefix_grade_items AS gi  JOIN prefix_course_modules AS cm ON  gi.iteminstance = cm.instance WHERE gi.gradetype = 1 AND gi.hidden != 1 AND gi.courseid = c.id AND cm.course = c.id AND cm.section = cs.id ) AS &#039;activities&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FROM&lt;br /&gt;
prefix_course AS c &lt;br /&gt;
&lt;br /&gt;
#get grade sections&lt;br /&gt;
LEFT JOIN prefix_course_sections AS cs ON cs.course = c.id  AND cs.section &amp;gt; 0 AND cs.section &amp;lt;=14&lt;br /&gt;
LEFT JOIN prefix_course_modules AS cm ON cm.course = c.id AND cm.section = cs.id&lt;br /&gt;
&lt;br /&gt;
#LEFT JOIN prefix_assign AS asg ON asg.id = cm.instance&lt;br /&gt;
&lt;br /&gt;
JOIN prefix_grade_items AS gi  ON  gi.iteminstance = cm.instance AND gi.gradetype = 1 AND gi.hidden != 1 AND gi.courseid = c.id AND cm.course = c.id AND cm.section = cs.id&lt;br /&gt;
&lt;br /&gt;
WHERE&lt;br /&gt;
c.id = %%COURSEID%%&lt;br /&gt;
AND cs.visible = 1&lt;br /&gt;
&lt;br /&gt;
ORDER BY gi.itemmodule, cs.section&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Grade and Course Completion Reports==&lt;br /&gt;
===Site-Wide Grade Report with All Items===&lt;br /&gt;
Shows grades for all course items along with course totals for each student. Works with ad-hoc reports or Configurable Reports&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.firstname AS &#039;First&#039; , u.lastname AS &#039;Last&#039;, &lt;br /&gt;
u.firstname + &#039; &#039; + u.lastname AS &#039;Display Name&#039;, &lt;br /&gt;
c.fullname AS &#039;Course&#039;, &lt;br /&gt;
cc.name AS &#039;Category&#039;,&lt;br /&gt;
&lt;br /&gt;
CASE &lt;br /&gt;
  WHEN gi.itemtype = &#039;course&#039; &lt;br /&gt;
   THEN c.fullname + &#039; Course Total&#039;&lt;br /&gt;
  ELSE gi.itemname&lt;br /&gt;
END AS &#039;Item Name&#039;,&lt;br /&gt;
&lt;br /&gt;
ROUND(gg.finalgrade,2) AS Grade,&lt;br /&gt;
DATEADD(ss,gg.timemodified,&#039;1970-01-01&#039;) AS Time&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_context AS ctx ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_grade_grades AS gg ON gg.userid = u.id&lt;br /&gt;
JOIN prefix_grade_items AS gi ON gi.id = gg.itemid&lt;br /&gt;
JOIN prefix_course_categories as cc ON cc.id = c.category&lt;br /&gt;
&lt;br /&gt;
WHERE  gi.courseid = c.id &lt;br /&gt;
ORDER BY lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
For MySQL users, you&#039;ll need to use the MySQL DATE_ADD function instead of DATEADD. Replace the line:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DATEADD(ss,gg.timemodified,&#039;1970-01-01&#039;) AS Time&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
with:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
FROM_UNIXTIME(gg.timemodified) AS Time&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
And:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
u.firstname + &#039; &#039; + u.lastname AS &#039;Display Name&#039;, &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
with:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
CONCAT(u.firstname,&#039; &#039;,u.lastname) AS &#039;Display Name&#039;, &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Site-Wide Grade Report with Just Course Totals===&lt;br /&gt;
A second site-wide grade report for all students that just shows course totals. Works with ad-hoc reports or Configurable Reports&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.firstname AS &#039;First&#039; , u.lastname AS &#039;Last&#039;, u.firstname + &#039; &#039; + u.lastname AS &#039;Display Name&#039;, &lt;br /&gt;
cc.name AS &#039;Category&#039;,&lt;br /&gt;
CASE &lt;br /&gt;
  WHEN gi.itemtype = &#039;course&#039; &lt;br /&gt;
   THEN c.fullname + &#039; Course Total&#039;&lt;br /&gt;
  ELSE gi.itemname&lt;br /&gt;
END AS &#039;Item Name&#039;,&lt;br /&gt;
&lt;br /&gt;
ROUND(gg.finalgrade,2) AS Grade,&lt;br /&gt;
DATEADD(ss,gg.timemodified,&#039;1970-01-01&#039;) AS Time&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_context AS ctx ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_grade_grades AS gg ON gg.userid = u.id&lt;br /&gt;
JOIN prefix_grade_items AS gi ON gi.id = gg.itemid&lt;br /&gt;
JOIN prefix_course_categories as cc ON cc.id = c.category&lt;br /&gt;
&lt;br /&gt;
WHERE  gi.courseid = c.id AND gi.itemtype = &#039;course&#039;&lt;br /&gt;
&lt;br /&gt;
ORDER BY lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For MySQL users:&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.firstname AS &#039;First&#039; , u.lastname AS &#039;Last&#039;, CONCAT(u.firstname , &#039; &#039; , u.lastname) AS &#039;Display Name&#039;, &lt;br /&gt;
c.fullname AS &#039;Course&#039;, &lt;br /&gt;
cc.name AS &#039;Category&#039;,&lt;br /&gt;
CASE &lt;br /&gt;
  WHEN gi.itemtype = &#039;course&#039; &lt;br /&gt;
   THEN CONCAT(c.fullname, &#039; - Total&#039;)&lt;br /&gt;
  ELSE gi.itemname&lt;br /&gt;
END AS &#039;Item Name&#039;,&lt;br /&gt;
&lt;br /&gt;
ROUND(gg.finalgrade,2) AS Grade,&lt;br /&gt;
FROM_UNIXTIME(gg.timemodified) AS TIME&lt;br /&gt;
 &lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_context AS ctx ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_grade_grades AS gg ON gg.userid = u.id&lt;br /&gt;
JOIN prefix_grade_items AS gi ON gi.id = gg.itemid&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
 &lt;br /&gt;
WHERE  gi.courseid = c.id AND gi.itemtype = &#039;course&#039;&lt;br /&gt;
ORDER BY lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Learner report by Learner with grades===&lt;br /&gt;
Which Learners in which course and what are the grades&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.firstname AS &#039;Name&#039; , u.lastname AS &#039;Surname&#039;, c.fullname AS &#039;Course&#039;, cc.name AS &#039;Category&#039;, &lt;br /&gt;
CASE WHEN gi.itemtype = &#039;Course&#039;    &lt;br /&gt;
THEN c.fullname + &#039; Course Total&#039;  &lt;br /&gt;
ELSE gi.itemname &lt;br /&gt;
END AS &#039;Item Name&#039;, ROUND(gg.finalgrade,2) AS Score,ROUND(gg.rawgrademax,2) AS Max, ROUND(gg.finalgrade / gg.rawgrademax * 100 ,2) as Percentage,&lt;br /&gt;
&lt;br /&gt;
if (ROUND(gg.finalgrade / gg.rawgrademax * 100 ,2) &amp;gt; 79,&#039;Yes&#039; , &#039;No&#039;) as Pass&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c &lt;br /&gt;
JOIN prefix_context AS ctx ON c.id = ctx.instanceid &lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id &lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid &lt;br /&gt;
JOIN prefix_grade_grades AS gg ON gg.userid = u.id &lt;br /&gt;
JOIN prefix_grade_items AS gi ON gi.id = gg.itemid &lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category &lt;br /&gt;
WHERE  gi.courseid = c.id and gi.itemname != &#039;Attendance&#039;&lt;br /&gt;
ORDER BY `Name` ASC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===User Course Completion===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
A very simple report with a list of course completion status by username. Completions are noted by date, blank otherwise. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
  u.username, &lt;br /&gt;
  c.shortname,  &lt;br /&gt;
 DATE_FORMAT(FROM_UNIXTIME(p.timecompleted),&#039;%Y-%m-%d&#039;) AS completed&lt;br /&gt;
FROM prefix_course_completions AS p&lt;br /&gt;
JOIN prefix_course AS c ON p.course = c.id&lt;br /&gt;
JOIN prefix_user AS u ON p.userid = u.id&lt;br /&gt;
WHERE c.enablecompletion = 1&lt;br /&gt;
ORDER BY u.username&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===User Course Completion with Criteria===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
A report with course completions by username, with Aggregation method, Criteria types, and Criteria detail where available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.username AS user, &lt;br /&gt;
c.shortname AS course,&lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(t.timecompleted),&#039;%Y-%m-%d&#039;) AS completed,&lt;br /&gt;
CASE&lt;br /&gt;
WHEN (SELECT a.method FROM prefix_course_completion_aggr_methd AS a  WHERE (a.course = c.id AND a.criteriatype IS NULL) = 1) THEN &amp;quot;Any&amp;quot;&lt;br /&gt;
ELSE &amp;quot;All&amp;quot;&lt;br /&gt;
END AS aggregation,&lt;br /&gt;
CASE &lt;br /&gt;
WHEN p.criteriatype = 1 THEN &amp;quot;Self&amp;quot;&lt;br /&gt;
WHEN p.criteriatype = 2 THEN &amp;quot;By Date&amp;quot;&lt;br /&gt;
WHEN p.criteriatype = 3 THEN &amp;quot;Unenrol Status&amp;quot;&lt;br /&gt;
WHEN p.criteriatype = 4 THEN &amp;quot;Activity&amp;quot;&lt;br /&gt;
WHEN p.criteriatype = 5 THEN &amp;quot;Duration&amp;quot;&lt;br /&gt;
WHEN p.criteriatype = 6 THEN &amp;quot;Course Grade&amp;quot;&lt;br /&gt;
WHEN p.criteriatype = 7 THEN &amp;quot;Approve by Role&amp;quot;&lt;br /&gt;
WHEN p.criteriatype = 8 THEN &amp;quot;Previous Course&amp;quot;&lt;br /&gt;
END AS criteriatype,&lt;br /&gt;
CASE &lt;br /&gt;
WHEN p.criteriatype = 1 THEN &amp;quot;*&amp;quot;&lt;br /&gt;
WHEN p.criteriatype = 2 THEN DATE_FORMAT(FROM_UNIXTIME(p.timeend),&#039;%Y-%m-%d&#039;)&lt;br /&gt;
WHEN p.criteriatype = 3 THEN t.unenroled&lt;br /&gt;
WHEN p.criteriatype = 4 THEN &lt;br /&gt;
CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/&#039;,p.module,&#039;/view.php?id=&#039;,p.moduleinstance,&#039;&amp;quot;&amp;gt;&#039;,p.module,&#039;&amp;lt;/a&amp;gt;&#039;)&lt;br /&gt;
WHEN p.criteriatype = 5 THEN p.enrolperiod&lt;br /&gt;
WHEN p.criteriatype = 6 THEN CONCAT(&#039;Needed: &#039;,ROUND(p.gradepass,2),&#039; Achieved: &#039;,ROUND(t.gradefinal,2)) &lt;br /&gt;
WHEN p.criteriatype = 7 THEN p.role&lt;br /&gt;
WHEN p.criteriatype = 8 THEN (SELECT pc.shortname FROM prefix_course AS pc WHERE pc.id = p.courseinstance)&lt;br /&gt;
END AS criteriadetail &lt;br /&gt;
FROM prefix_course_completion_crit_compl AS t&lt;br /&gt;
JOIN prefix_user AS u ON t.userid = u.id&lt;br /&gt;
JOIN prefix_course AS c ON t.course = c.id&lt;br /&gt;
JOIN prefix_course_completion_criteria AS p ON t.criteriaid = p.id&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Courses with Completion Enabled and their settings===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
List of all courses with completion enabled and their Aggregation setting, Criteria types, and Criteria details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SELECT c.shortname AS Course, &lt;br /&gt;
CASE&lt;br /&gt;
WHEN (SELECT a.method FROM prefix_course_completion_aggr_methd AS a  WHERE (a.course = t.course AND a.criteriatype IS NULL)) = 2 THEN &amp;quot;All&amp;quot;&lt;br /&gt;
ELSE &amp;quot;Any&amp;quot;&lt;br /&gt;
END AS Course_Aggregation,&lt;br /&gt;
CASE&lt;br /&gt;
WHEN t.criteriatype = 1 THEN &amp;quot;Self completion&amp;quot;&lt;br /&gt;
WHEN t.criteriatype = 2 THEN &amp;quot;Date done by&amp;quot; &lt;br /&gt;
WHEN t.criteriatype = 3 THEN &amp;quot;Unenrolement&amp;quot; &lt;br /&gt;
WHEN t.criteriatype = 4 THEN &amp;quot;Activity completion&amp;quot;   &lt;br /&gt;
WHEN t.criteriatype = 5 THEN &amp;quot;Duration in days&amp;quot; &lt;br /&gt;
WHEN t.criteriatype = 6 THEN &amp;quot;Final grade&amp;quot;     &lt;br /&gt;
WHEN t.criteriatype = 7 THEN &amp;quot;Approve by role&amp;quot; &lt;br /&gt;
WHEN t.criteriatype = 8 THEN &amp;quot;Previous course&amp;quot;&lt;br /&gt;
END AS Criteria_type,&lt;br /&gt;
CASE&lt;br /&gt;
WHEN t.criteriatype = 1 THEN &amp;quot;On&amp;quot;&lt;br /&gt;
WHEN t.criteriatype = 2 THEN DATE_FORMAT(FROM_UNIXTIME(t.timeend),&#039;%Y-%m-%d&#039;)&lt;br /&gt;
WHEN t.criteriatype = 3 THEN &amp;quot;On&amp;quot;&lt;br /&gt;
WHEN t.criteriatype = 4 THEN&lt;br /&gt;
CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/&#039;,t.module,&#039;/view.php?id=&#039;,t.moduleinstance,&#039;&amp;quot;&amp;gt;&#039;,t.module,&#039;&amp;lt;/a&amp;gt;&#039;)&lt;br /&gt;
WHEN t.criteriatype = 5 THEN ROUND(t.enrolperiod/86400)&lt;br /&gt;
WHEN t.criteriatype = 6 THEN ROUND(t.gradepass,2)&lt;br /&gt;
WHEN t.criteriatype = 7 THEN (SELECT r.shortname FROM prefix_role AS r WHERE r.id = t.role)&lt;br /&gt;
WHEN t.criteriatype = 8 THEN (SELECT pc.shortname FROM prefix_course AS pc WHERE pc.id = t.courseinstance)&lt;br /&gt;
END AS Criteria_detail&lt;br /&gt;
FROM prefix_course_completion_criteria as t&lt;br /&gt;
JOIN prefix_course AS c ON t.course = c.id&lt;br /&gt;
WHERE c.enablecompletion = 1&lt;br /&gt;
ORDER BY course&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Course Completion Report with custom dates===&lt;br /&gt;
&lt;br /&gt;
List of users who completed multiple or single course/s from a start date to end date chosen by the user. The output gives username, name, course name, completion date and score&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SELECT u.username AS &#039;User Name&#039;,&lt;br /&gt;
CONCAT(u.firstname , &#039; &#039; , u.lastname) AS &#039;Name&#039;,&lt;br /&gt;
c.shortname AS &#039;Course Name&#039;, &lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(p.timecompleted),&#039;%W %e %M, %Y&#039;) AS &#039;Completed Date&#039;,&lt;br /&gt;
ROUND(c4.gradefinal,2) AS &#039;Score&#039;&lt;br /&gt;
FROM prefix_course_completions AS p&lt;br /&gt;
JOIN prefix_course AS c ON p.course = c.id&lt;br /&gt;
JOIN prefix_user AS u ON p.userid = u.id&lt;br /&gt;
JOIN prefix_course_completion_crit_compl AS c4 ON u.id = c4.userid&lt;br /&gt;
WHERE c.enablecompletion = 1  AND (p.timecompleted IS NOT NULL OR p.timecompleted !=&#039;&#039;) &lt;br /&gt;
AND (p.timecompleted&amp;gt;= :start_date AND p.timecompleted&amp;lt;=:end_date)&lt;br /&gt;
GROUP BY u.username&lt;br /&gt;
ORDER BY c.shortname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Scales used in activities===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT scale.name&lt;br /&gt;
,CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
,CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/&#039;,gi.itemmodule,&#039;/view.php?id=&#039;,cm.id,&#039;&amp;quot;&amp;gt;&#039;,gi.itemname,&#039;&amp;lt;/a&amp;gt;&#039;) AS &amp;quot;Module View&amp;quot;&lt;br /&gt;
,CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/modedit.php?up&#039;,&#039;date=&#039;,cm.id,&#039;&amp;quot;&amp;gt;&#039;,gi.itemname,&#039;&amp;lt;/a&amp;gt;&#039;) AS &amp;quot;Module Settings&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_grade_items AS gi&lt;br /&gt;
JOIN prefix_course AS c ON c.id = gi.courseid&lt;br /&gt;
JOIN prefix_course_modules AS cm ON cm.course = gi.courseid AND cm.instance = gi.iteminstance&lt;br /&gt;
JOIN prefix_scale AS scale ON scale.id = gi.scaleid&lt;br /&gt;
WHERE gi.scaleid IS NOT NULL&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Extra Credit Items by Name Only===&lt;br /&gt;
Contributed by Eric Strom&lt;br /&gt;
&lt;br /&gt;
This query identifies grade items in visible courses with student enrollment that have &amp;quot;extra credit&amp;quot; in the name of the item but set as extra credit in the grade settings. Includes the defined course start date, count of students and instructors, and a clickable email link of instructor (first found record if more than one).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT DATE(FROM_UNIXTIME(c.startdate)) AS StartDate, &lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/grade/edit/tree/index.php&#039;,CHAR(63),&#039;id=&#039;,&lt;br /&gt;
c.id,&#039;&amp;quot;&amp;gt;&#039;,c.idnumber,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course_ID, gi.itemname AS Item_Name&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT( ra.userid ) FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5 AND ctx.instanceid = c.id) AS Students&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT( ra.userid ) FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id) AS Instructors&lt;br /&gt;
&lt;br /&gt;
,(SELECT DISTINCT concat(&#039;&amp;lt;a href=&amp;quot;mailto:&#039;,u.email,&#039;&amp;quot;&amp;gt;&#039;,u.email,&#039;&amp;lt;/a&amp;gt;&#039;)&lt;br /&gt;
  FROM prefix_role_assignments AS ra&lt;br /&gt;
  JOIN prefix_user AS u ON ra.userid = u.id&lt;br /&gt;
  JOIN prefix_context AS ctx ON ctx.id = ra.contextid&lt;br /&gt;
  WHERE ra.roleid = 3 AND ctx.instanceid = c.id AND ctx.contextlevel = 50 LIMIT 1) AS &#039;Instructor_Email&#039;&lt;br /&gt;
&lt;br /&gt;
,now() AS Report_Timestamp&lt;br /&gt;
&lt;br /&gt;
FROM prefix_grade_items AS gi&lt;br /&gt;
JOIN prefix_course AS c ON gi.courseid = c.id&lt;br /&gt;
&lt;br /&gt;
WHERE gi.itemname LIKE &#039;%extra credit%&#039; &lt;br /&gt;
	AND gi.gradetype = &#039;1&#039; &lt;br /&gt;
	AND gi.hidden = &#039;0&#039; &lt;br /&gt;
	AND gi.aggregationcoef = &#039;0&#039; &lt;br /&gt;
	AND c.visible = 1&lt;br /&gt;
	AND (SELECT COUNT( ra.userid ) FROM prefix_role_assignments AS ra JOIN prefix_context AS ctx ON ra.contextid = ctx.id WHERE ra.roleid = 5 AND ctx.instanceid = c.id) &amp;gt; 0&lt;br /&gt;
&lt;br /&gt;
GROUP BY Course_ID, gi.id&lt;br /&gt;
ORDER BY StartDate, Course_ID&lt;br /&gt;
 &lt;br /&gt;
%%FILTER_SEARCHTEXT:Course_ID:~%%&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Site Wide Number of Courses Completed by User===&lt;br /&gt;
Contributed by Ken St. John&lt;br /&gt;
&lt;br /&gt;
Simple report that shows the number of completed courses for all users site wide&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.lastname, u.firstname,&lt;br /&gt;
COUNT(p.timecompleted) AS TotalCompletions&lt;br /&gt;
FROM prefix_course_completions AS p&lt;br /&gt;
JOIN prefix_user AS u ON p.userid = u.id&lt;br /&gt;
GROUP BY p.userid&lt;br /&gt;
ORDER BY u.lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Activity Module Reports==&lt;br /&gt;
&lt;br /&gt;
=== User activity completions with dates===&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
This report shows the users completion status of activities across all courses. It is intended to be uses with Configurable Reports filters for user, start and end times, and also to be able to search the Module names. &lt;br /&gt;
&lt;br /&gt;
Note: The CASE statement with module numbers may differ on different systems, depending on the number give to the module when the site was created or the module added to the site. These are common default numbers, but you should check your id numbers for them in the course_modules table and adjust as required. You can also add other, third-party plugins too if you wish. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
u.username As &#039;User&#039;,&lt;br /&gt;
c.shortname AS &#039;Course&#039;,&lt;br /&gt;
m.name AS Activitytype, &lt;br /&gt;
CASE &lt;br /&gt;
    WHEN cm.module = 1 THEN (SELECT a1.name FROM prefix_assign a1            WHERE a1.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 2 THEN (SELECT a2.name FROM prefix_assignment a2    WHERE a2.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 3 THEN (SELECT a3.name FROM prefix_book a3               WHERE a3.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 4 THEN (SELECT a4.name FROM prefix_chat a4                WHERE a4.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 5 THEN (SELECT a5.name FROM prefix_choice a5            WHERE a5.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 6 THEN (SELECT a6.name FROM prefix_data a6                WHERE a6.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 7 THEN (SELECT a7.name FROM prefix_feedback a7        WHERE a7.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 8 THEN (SELECT a8.name FROM prefix_folder a8              WHERE a8.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 9 THEN (SELECT a9.name FROM prefix_forum a9              WHERE a9.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 10 THEN (SELECT a10.name FROM prefix_glossary a10         WHERE a10.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 11 THEN (SELECT a11.name FROM prefix_imscp  a11           WHERE a11.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 12 THEN (SELECT a12.name FROM prefix_label a12              WHERE a12.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 13 THEN (SELECT a13.name FROM prefix_lesson a13            WHERE a13.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 14 THEN (SELECT a14.name FROM prefix_lti a14                    WHERE a14.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 15 THEN (SELECT a15.name FROM prefix_page a15               WHERE a15.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 16 THEN (SELECT a16.name FROM prefix_quiz  a16               WHERE a16.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 17 THEN (SELECT a17.name FROM prefix_resource a17         WHERE a17.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 18 THEN (SELECT a18.name FROM prefix_scorm a18             WHERE a18.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 19 THEN (SELECT a19.name FROM prefix_survey a19             WHERE a19.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 20 THEN (SELECT a20.name FROM prefix_url a20                      WHERE a20.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 21 THEN (SELECT a21.name FROM prefix_wiki a21                    WHERE a21.id = cm.instance)&lt;br /&gt;
    WHEN cm.module = 22 THEN (SELECT a22.name FROM prefix_workshop a22           WHERE a22.id = cm.instance)&lt;br /&gt;
END AS Actvityname,&lt;br /&gt;
# cm.section AS Coursesection,&lt;br /&gt;
CASE&lt;br /&gt;
    WHEN cm.completion = 0 THEN &#039;0 None&#039;&lt;br /&gt;
    WHEN cm.completion = 1 THEN &#039;1 Self&#039;&lt;br /&gt;
    WHEN cm.completion = 2 THEN &#039;2 Auto&#039;&lt;br /&gt;
END AS Activtycompletiontype, &lt;br /&gt;
CASE&lt;br /&gt;
   WHEN cmc.completionstate = 0 THEN &#039;In Progress&#039;&lt;br /&gt;
   WHEN cmc.completionstate = 1 THEN &#039;Completed&#039;&lt;br /&gt;
   WHEN cmc.completionstate = 2 THEN &#039;Completed with Pass&#039;&lt;br /&gt;
   WHEN cmc.completionstate = 3 THEN &#039;Completed with Fail&#039;&lt;br /&gt;
   ELSE &#039;Unknown&#039;&lt;br /&gt;
END AS &#039;Progress&#039;, &lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(cmc.timemodified), &#039;%Y-%m-%d %H:%i&#039;) AS &#039;When&#039;&lt;br /&gt;
FROM prefix_course_modules_completion cmc &lt;br /&gt;
JOIN prefix_user u ON cmc.userid = u.id&lt;br /&gt;
JOIN prefix_course_modules cm ON cmc.coursemoduleid = cm.id&lt;br /&gt;
JOIN prefix_course c ON cm.course = c.id&lt;br /&gt;
JOIN prefix_modules m ON cm.module = m.id&lt;br /&gt;
# skip the predefined admin and guest user&lt;br /&gt;
WHERE u.id &amp;gt; 2&lt;br /&gt;
# config reports filters&lt;br /&gt;
%%FILTER_USERS:u.username%%&lt;br /&gt;
%%FILTER_SEARCHTEXT:m.name:~%%&lt;br /&gt;
%%FILTER_STARTTIME:cmc.timemodified:&amp;gt;%% %%FILTER_ENDTIME:cmc.timemodified:&amp;lt;%%&lt;br /&gt;
&lt;br /&gt;
ORDER BY u.username&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How many SCORM activities are used in each Course===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT cm.course,c.fullname ,m.name &lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/scorm/index.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,count(cm.id),&#039;&amp;lt;/a&amp;gt;&#039;) AS Counter&lt;br /&gt;
 &lt;br /&gt;
FROM `prefix_course_modules` as cm &lt;br /&gt;
  JOIN prefix_modules as m ON cm.module=m.id &lt;br /&gt;
  JOIN prefix_course as c ON cm.course = c.id &lt;br /&gt;
WHERE m.name LIKE &#039;%scorm%&#039; &lt;br /&gt;
GROUP BY cm.course,cm.module &lt;br /&gt;
ORDER BY count(cm.id) desc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SCORM Usage by Course Start Date===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College &lt;br /&gt;
&lt;br /&gt;
Report of number of inclusions of SCORM activities in courses, filtered by course start date.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
&lt;br /&gt;
CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php&#039;,CHAR(63),&#039;id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.shortname,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;course&#039;&lt;br /&gt;
&lt;br /&gt;
, cc.name AS &#039;Category&#039;&lt;br /&gt;
, scm.name AS &#039;Sample Activity Name&#039;&lt;br /&gt;
, FROM_UNIXTIME(c.startdate) AS &#039;Course Start Date&#039;&lt;br /&gt;
, COUNT(DISTINCT cm.id) AS &#039;Resources Used&#039;&lt;br /&gt;
#, FROM_UNIXTIME(cm.added) AS &#039;resource added&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id AND m.name LIKE &#039;SCO%&#039;&lt;br /&gt;
&lt;br /&gt;
JOIN prefix_course AS c ON c.id = cm.course&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
JOIN prefix_scorm AS scm ON scm.id = cm.instance&lt;br /&gt;
&lt;br /&gt;
WHERE&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
%%FILTER_STARTTIME:c.startdate:&amp;gt;%%&lt;br /&gt;
%%FILTER_ENDTIME:c.startdate:&amp;lt;%%&lt;br /&gt;
&lt;br /&gt;
GROUP BY c.shortname, m.name&lt;br /&gt;
ORDER BY c.startdate, c.shortname &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LTI (External Tool) Usage by Course Start Date===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College &lt;br /&gt;
&lt;br /&gt;
Report of number of inclusions of  LTI (External Tool) Usage activities in courses, filtered by course start date.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
&lt;br /&gt;
CONCAT(&#039;&amp;lt;a target=&amp;quot;_blank&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php&#039;,CHAR(63),&#039;id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.shortname,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;course&#039;&lt;br /&gt;
&lt;br /&gt;
, cc.name AS &#039;Category&#039;&lt;br /&gt;
, lti.name AS &#039;Sample Activity Name&#039;&lt;br /&gt;
, FROM_UNIXTIME(c.startdate) AS &#039;Course Start Date&#039;&lt;br /&gt;
, COUNT(DISTINCT cm.id) AS &#039;Resources Used&#039;&lt;br /&gt;
#, FROM_UNIXTIME(cm.added) AS &#039;resource added&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id AND m.name LIKE &#039;lti&#039;&lt;br /&gt;
&lt;br /&gt;
JOIN prefix_course AS c ON c.id = cm.course&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
JOIN prefix_lti AS lti ON lti.id = cm.instance&lt;br /&gt;
WHERE&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
%%FILTER_STARTTIME:c.startdate:&amp;gt;%%&lt;br /&gt;
%%FILTER_ENDTIME:c.startdate:&amp;lt;%%&lt;br /&gt;
&lt;br /&gt;
GROUP BY c.shortname, m.name&lt;br /&gt;
ORDER BY c.startdate, c.shortname &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Detailed ACTIONs for each MODULE===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT module,action,count(id) as counter&lt;br /&gt;
FROM prefix_log&lt;br /&gt;
GROUP BY module,action&lt;br /&gt;
ORDER BY module,counter desc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Most popular ACTIVITY===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT COUNT(l.id) hits, module&lt;br /&gt;
FROM prefix_log l&lt;br /&gt;
WHERE module != &#039;login&#039; AND module != &#039;course&#039; AND module != &#039;role&#039;&lt;br /&gt;
GROUP BY module&lt;br /&gt;
ORDER BY hits DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System wide use of ACTIVITIES and RESOURCES===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT count( cm.id ) AS counter, m.name&lt;br /&gt;
FROM `prefix_course_modules` AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
GROUP BY cm.module&lt;br /&gt;
ORDER BY counter DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LOG file ACTIONS per MODULE per COURSE (IDs)===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
select course,module,action,count(action) as summa from prefix_log&lt;br /&gt;
where action &amp;lt;&amp;gt; &#039;new&#039;&lt;br /&gt;
group by course,action,module&lt;br /&gt;
order by course,module,action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Wide usage count of various course Activities===&lt;br /&gt;
(Tested and works fine in Moodle 2.x)&lt;br /&gt;
Like: Forum, Wiki, Blog, Assignment, Database,&lt;br /&gt;
#Within specific category&lt;br /&gt;
#Teacher name in course&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) as Course&lt;br /&gt;
&lt;br /&gt;
,(SELECT CONCAT(u.firstname,&#039; &#039;, u.lastname) AS Teacher&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) AS Teacher &lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%wiki%&#039;) AS Wikis&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%blog%&#039;) AS Blogs&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM &lt;br /&gt;
prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%forum%&#039;) AS Forums&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%data%&#039;) AS Databses&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%assignment%&#039;) AS Assignments&lt;br /&gt;
&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5 AND ctx.instanceid = c.id) AS Students&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
WHERE c.category IN ( 18)&lt;br /&gt;
ORDER BY Wikis DESC,Blogs DESC, Forums DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Course wiki usage/activity over the last 6 semesters===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &amp;quot;Courses with Wikis&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM &lt;br /&gt;
prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = cm.course&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%wiki%&#039;&lt;br /&gt;
 and c.fullname LIKE CONCAT(&#039;%&#039;,&#039;2010&#039;,&#039;%&#039;) and c.fullname LIKE &#039;%Semester A%&#039;) AS &#039;2010 &amp;lt;br/&amp;gt; Semester A&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM &lt;br /&gt;
prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = cm.course&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%wiki%&#039;&lt;br /&gt;
 and c.fullname LIKE CONCAT(&#039;%&#039;,&#039;2010&#039;,&#039;%&#039;) and c.fullname LIKE &#039;%Semester B%&#039;) AS &#039;2010 &amp;lt;br/&amp;gt; Semester B&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM &lt;br /&gt;
prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = cm.course&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%wiki%&#039;&lt;br /&gt;
 and c.fullname LIKE CONCAT(&#039;%&#039;,&#039;תשעא&#039;,&#039;%&#039;) and c.fullname LIKE &#039;%סמסטר א%&#039;) AS &#039;תשעא &amp;lt;br/&amp;gt; סמסטר א&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM &lt;br /&gt;
prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = cm.course&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%wiki%&#039;&lt;br /&gt;
 and c.fullname LIKE CONCAT(&#039;%&#039;,&#039;תשעא&#039;,&#039;%&#039;) and c.fullname LIKE &#039;%סמסטר ב%&#039;) AS &#039;תשעא &amp;lt;br/&amp;gt; סמסטר ב&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM &lt;br /&gt;
prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = cm.course&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%wiki%&#039;&lt;br /&gt;
 and c.fullname LIKE CONCAT(&#039;%&#039;,&#039;תשעב&#039;,&#039;%&#039;) and c.fullname LIKE &#039;%סמסטר א%&#039;) AS &#039;תשעב &amp;lt;br/&amp;gt; סמסטר א&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM &lt;br /&gt;
prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = cm.course&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%wiki%&#039;&lt;br /&gt;
 and c.fullname LIKE CONCAT(&#039;%&#039;,&#039;תשעב&#039;,&#039;%&#039;) and c.fullname LIKE &#039;%סמסטר ב%&#039;) AS &#039;תשעב &amp;lt;br/&amp;gt; סמסטר ב&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM &lt;br /&gt;
prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = cm.course&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%wiki%&#039;&lt;br /&gt;
 and c.fullname LIKE CONCAT(&#039;%&#039;,&#039;תשעג&#039;,&#039;%&#039;) and c.fullname LIKE &#039;%סמסטר א%&#039;) AS &#039;תשעג &amp;lt;br/&amp;gt; סמסטר א&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM &lt;br /&gt;
prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
JOIN prefix_course AS c ON c.id = cm.course&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%wiki%&#039;&lt;br /&gt;
 and c.fullname LIKE CONCAT(&#039;%&#039;,&#039;תשעג&#039;,&#039;%&#039;) and c.fullname LIKE &#039;%סמסטר ב%&#039;) AS &#039;תשעג &amp;lt;br/&amp;gt; סמסטר ב&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Detailed WIKI activity (per wiki per course)===&lt;br /&gt;
Including Number of Students in course (for reference)&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,cm.course,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) as CourseID  &lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5 AND ctx.instanceid = c.id ) AS Students&lt;br /&gt;
,m.name&lt;br /&gt;
, ( SELECT count(id) FROM prefix_log WHERE cmid = cm.id AND action LIKE &#039;%updat%&#039; ) as &#039;UPDAT E&#039;&lt;br /&gt;
, ( SELECT count(id) FROM prefix_log WHERE cmid = cm.id AND action LIKE &#039;%annotate%&#039; ) as ANNOTATE&lt;br /&gt;
, ( SELECT count(id) FROM prefix_log WHERE cmid = cm.id AND action LIKE &#039;%comment%&#039; ) as COMMENT&lt;br /&gt;
, ( SELECT count(id) FROM prefix_log WHERE cmid = cm.id AND action LIKE &#039;%add%&#039; ) as &#039;A DD&#039;&lt;br /&gt;
, ( SELECT count(id) FROM prefix_log WHERE cmid = cm.id AND action LIKE &#039;%edit%&#039; ) as EDIT&lt;br /&gt;
, ( SELECT count(id) FROM prefix_log WHERE cmid = cm.id AND action NOT LIKE &#039;%view%&#039; ) as &#039;All (NO View)&#039;&lt;br /&gt;
FROM `prefix_course_modules` as cm &lt;br /&gt;
JOIN prefix_modules as m ON cm.module=m.id &lt;br /&gt;
JOIN prefix_course as c ON cm.course = c.id &lt;br /&gt;
WHERE m.name LIKE &#039;%wiki%&#039;&lt;br /&gt;
GROUP BY cm.course,cm.module&lt;br /&gt;
ORDER BY &#039;All (NO View)&#039; DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Wiki usage, system wide===&lt;br /&gt;
(you can filter the output by selecting some specific course categories : &amp;quot;WHERE c.category IN ( 8,13,15)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) as Course&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%wiki%&#039;) AS Wikis&lt;br /&gt;
&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.course = c.id AND l.module LIKE &#039;%wiki%&#039;) AS &#039;WikiActivity&amp;lt;br/&amp;gt;ALL&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.course = c.id AND l.module LIKE &#039;%wiki%&#039; and l.action LIKE &#039;%add%&#039; ) AS &#039;WikiActivity&amp;lt;br/&amp;gt;ADD&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.course = c.id AND l.module LIKE &#039;%wiki%&#039; and l.action LIKE &#039;%edit%&#039; ) AS &#039;WikiActivity&amp;lt;br/&amp;gt;EDIT&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.course = c.id AND l.module LIKE &#039;%wiki%&#039; and l.action LIKE &#039;%annotate%&#039; ) AS &#039;WikiActivity&amp;lt;br/&amp;gt;ANNOTATE&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.course = c.id AND l.module LIKE &#039;%wiki%&#039; and l.action LIKE &#039;%comments%&#039; ) AS &#039;WikiActivity&amp;lt;br/&amp;gt;Comments&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5 AND ctx.instanceid = c.id) AS Students&lt;br /&gt;
&lt;br /&gt;
,(SELECT count(*) FROM prefix_ouwiki_pages as ouwp&lt;br /&gt;
JOIN prefix_ouwiki as ouw ON ouw.id = ouwp.subwikiid&lt;br /&gt;
WHERE ouw.course = c.id GROUP BY ouw.course  ) as OUWikiPages&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( DISTINCT nwp.pagename ) FROM prefix_wiki_pages AS nwp&lt;br /&gt;
JOIN prefix_wiki AS nw ON nw.id = nwp.dfwiki WHERE nw.course = c.id ) As NWikiPages&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
WHERE c.category IN ( 8,13,15)&lt;br /&gt;
HAVING Wikis &amp;gt; 0&lt;br /&gt;
ORDER BY &#039;WikiActivity&amp;lt;br/&amp;gt;ALL&#039; DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Aggregated Teacher activity by &amp;quot;WEB2&amp;quot; Modules===&lt;br /&gt;
(Tested and works fine in Moodle 2.x)&lt;br /&gt;
The NV column shows activity without VIEW log activity&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT ra.userid, u.firstname,u.lastname&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%wiki%&#039;) AS Wiki&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%wiki%&#039; AND l.action NOT LIKE &#039;%view%&#039;) AS Wiki_NV&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%forum%&#039;) AS Forum&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%forum%&#039; AND l.action NOT LIKE &#039;%view%&#039;) AS Forum_NV&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%blog%&#039;) AS Blog&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%blog%&#039; AND l.action NOT LIKE &#039;%view%&#039;) AS Blog_NV&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%assignment%&#039;) AS Assignment&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%assignment%&#039; AND l.action NOT LIKE &#039;%view%&#039;) AS Assignment_NV&lt;br /&gt;
FROM prefix_role_assignments AS ra &lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid &lt;br /&gt;
WHERE ra.roleid = 3 &lt;br /&gt;
GROUP BY ra.userid&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List all the certificates issued, sort by variables in the custom profile fields===&lt;br /&gt;
Note: The SQL queries look intimidating at first, but isn&#039;t really that difficult to learn. I&#039;ve seen in the forums that users wanted to do &#039;site-wide&#039; groups in 1.9x. This is sort of the idea. It pulls all the certificates issued to all users sorted by the custom profile fields, which in my case is the Units or Depts (i.e. my site wide groups). Why certificates? I&#039;ve explored with both grades and quizzes, the course admins are not really interested in the actual grades but whether the learner received a certificate (i.e. passed the course with x, y, z activities). It also saves me from creating groups and assigning them into the right groups. Even assigning in bulk is not efficient, since I have upward of 25 groups per course and constantly new learners enrolling in courses. The limitation is something to do with the server? as it only pull 5000 rows of data. If anyone figured out how to change this, please let me know. In the meantime, the work around is to pull only a few units/depts at a time to limit the number of rows. This is fine at the moment, since each course admin are only responsible for certain units/depts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
DATE_FORMAT( FROM_UNIXTIME(prefix_certificate_issues.timecreated), &#039;%Y-%m-%d&#039; ) AS Date,&lt;br /&gt;
prefix_certificate_issues.classname AS Topic,&lt;br /&gt;
prefix_certificate.name AS Certificate,&lt;br /&gt;
prefix_certificate_issues.studentname as Name,&lt;br /&gt;
prefix_user_info_data.data AS Units&lt;br /&gt;
&lt;br /&gt;
FROM&lt;br /&gt;
prefix_certificate_issues&lt;br /&gt;
&lt;br /&gt;
INNER JOIN prefix_user_info_data&lt;br /&gt;
on prefix_certificate_issues.userid = prefix_user_info_data.userid&lt;br /&gt;
&lt;br /&gt;
INNER JOIN prefix_certificate&lt;br /&gt;
on prefix_certificate_issues.certificateid = prefix_certificate.id&lt;br /&gt;
&lt;br /&gt;
WHERE prefix_user_info_data.data=&#039;Unit 1&#039;&lt;br /&gt;
OR prefix_user_info_data.data=&#039;Unit 2&#039;&lt;br /&gt;
OR prefix_user_info_data.data=&#039;Unit 3&#039;&lt;br /&gt;
&lt;br /&gt;
ORDER BY Units, Name, Topic ASC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== All Simple Certificates Earned in the Site===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
Basic report of all certificates earned with the Simple Certificate plugin module in the whole site, sorted by most recent first. (Note: this uses the MySQL [http://www.mysqltutorial.org/mysql-date_format/ DATE_FORMAT] function.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
CONCAT (u.firstname, &#039; &#039;,u.lastname) As &#039;User&#039;,&lt;br /&gt;
c.fullname AS &#039;Course&#039;,&lt;br /&gt;
sc.name AS &#039;Certificate&#039;,&lt;br /&gt;
DATE_FORMAT( FROM_UNIXTIME(sci.timecreated), &#039;%Y-%m-%d&#039; ) As &#039;Date Awarded&#039;&lt;br /&gt;
# sci.code &#039;CertificateId&#039;&lt;br /&gt;
FROM prefix_simplecertificate_issues sci&lt;br /&gt;
JOIN prefix_user u ON sci.userid = u.id&lt;br /&gt;
JOIN prefix_simplecertificate sc ON sci.certificateid = sc.id&lt;br /&gt;
JOIN prefix_course AS c ON sc.course = c.id&lt;br /&gt;
ORDER BY sci.timecreated DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to limit this to the most recent ones, you can add a condition to limit it to a certain number of days past. For example, adding this WHERE clause (above the ORDER BY) will show only those earned in the last 30 days:&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
WHERE DATEDIFF(NOW(),FROM_UNIXTIME(sci.timecreated) ) &amp;lt; 30&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Counter Blog usage in Courses,system wide===&lt;br /&gt;
What teachers in what courses, uses blogs and how many + student count in that course.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SELECT ( @counter := @counter+1) as counter, &lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) as Course&lt;br /&gt;
&lt;br /&gt;
,( SELECT DISTINCT CONCAT(u.firstname,&#039; &#039;,u.lastname)&lt;br /&gt;
  FROM prefix_role_assignments AS ra&lt;br /&gt;
  JOIN prefix_user AS u ON ra.userid = u.id&lt;br /&gt;
  JOIN prefix_context AS ctx ON ctx.id = ra.contextid&lt;br /&gt;
  WHERE ra.roleid = 3 AND ctx.instanceid = c.id AND ctx.contextlevel = 50 LIMIT 1) AS Teacher&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%blog%&#039;) AS Blogs&lt;br /&gt;
&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5 AND ctx.instanceid = c.id) AS Students&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c, (SELECT @counter := 0) as s_init&lt;br /&gt;
WHERE c.category IN ( 8,13,15)&lt;br /&gt;
HAVING Blogs &amp;gt; 0&lt;br /&gt;
ORDER BY Blogs DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Elluminate (Blackboard Collaborate) - system wide usage===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT e.name As Session ,er.recordingsize&lt;br /&gt;
,c.fullname As Course&lt;br /&gt;
,u.firstname,u.lastname &lt;br /&gt;
,DATE_FORMAT(FROM_UNIXTIME(e.timestart),&#039;%d-%m-%Y&#039;) AS dTimeStart&lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/moodle/mod/elluminate/loadrecording.php?id=&#039;,er.id,&#039;&amp;quot;&amp;gt;Show&amp;lt;/a&amp;gt;&#039;) AS RecordedSession&lt;br /&gt;
&lt;br /&gt;
FROM prefix_elluminate_recordings AS er&lt;br /&gt;
JOIN prefix_elluminate AS e ON e.meetingid = er.meetingid&lt;br /&gt;
JOIN prefix_course as c ON c.id = e.course&lt;br /&gt;
JOIN prefix_user AS u ON u.id = e.creator &lt;br /&gt;
ORDER BY er.recordingsize DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Choice ===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
Results of the Choice activity. For all courses, shows course shortname, username, the Choice text, and the answer chosen by the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.shortname AS course, u.username, h.name as question, o.text AS answer&lt;br /&gt;
FROM prefix_choice AS h&lt;br /&gt;
JOIN prefix_course AS c ON h.course = c.id&lt;br /&gt;
JOIN prefix_choice_answers AS a ON h.id = a.choiceid&lt;br /&gt;
JOIN prefix_user AS u ON a.userid = u.id&lt;br /&gt;
JOIN prefix_choice_options AS o ON a.optionid = o.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Assignment type usage in courses ===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
&lt;br /&gt;
CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/assign/index.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS &amp;quot;List assignments&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) FROM prefix_assign WHERE c.id = course) AS Assignments&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_assign_plugin_config AS apc&lt;br /&gt;
JOIN prefix_assign AS iassign ON iassign.id = apc.assignment &lt;br /&gt;
WHERE iassign.course = c.id AND apc.plugin = &#039;file&#039; AND apc.subtype = &#039;assignsubmission&#039; AND apc.name = &#039;enabled&#039; AND apc.value = &#039;1&#039;&lt;br /&gt;
#GROUP BY apc.plugin&lt;br /&gt;
) AS &amp;quot;File Assignments&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_assign_plugin_config AS apc&lt;br /&gt;
JOIN prefix_assign AS iassign ON iassign.id = apc.assignment &lt;br /&gt;
WHERE iassign.course = c.id AND apc.plugin = &#039;onlinetext&#039; AND apc.subtype = &#039;assignsubmission&#039; AND apc.name = &#039;enabled&#039; AND apc.value = &#039;1&#039;&lt;br /&gt;
) AS &amp;quot;Online Assignments&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_assign_plugin_config AS apc&lt;br /&gt;
JOIN prefix_assign AS iassign ON iassign.id = apc.assignment &lt;br /&gt;
WHERE iassign.course = c.id AND apc.plugin = &#039;pdf&#039; AND apc.subtype = &#039;assignsubmission&#039; AND apc.name = &#039;enabled&#039; AND apc.value = &#039;1&#039;&lt;br /&gt;
) AS &amp;quot;PDF Assignments&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_assign_plugin_config AS apc&lt;br /&gt;
JOIN prefix_assign AS iassign ON iassign.id = apc.assignment &lt;br /&gt;
WHERE iassign.course = c.id AND apc.plugin = &#039;offline&#039; AND apc.subtype = &#039;assignsubmission&#039; AND apc.name = &#039;enabled&#039; AND apc.value = &#039;1&#039;&lt;br /&gt;
) AS &amp;quot;Offline Assignments&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_assign_plugin_config AS apc&lt;br /&gt;
JOIN prefix_assign AS iassign ON iassign.id = apc.assignment &lt;br /&gt;
WHERE iassign.course = c.id AND apc.plugin = &#039;comments&#039; AND apc.subtype = &#039;assignsubmission&#039; AND apc.name = &#039;enabled&#039; AND apc.value = &#039;1&#039;&lt;br /&gt;
) AS &amp;quot;Assignments Comments&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_assign AS assign&lt;br /&gt;
JOIN prefix_course AS c ON c.id = assign.course&lt;br /&gt;
GROUP BY c.id &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Assignment Module Reports==&lt;br /&gt;
===All Ungraded Assignments===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: This query is for the deprecated old Assignment module from Moodle 2.2, not the new Assignments module. Please update this query if you are the author or it will be removed as the 2.2 Assignment module is no longer supported since release 2.7.&lt;br /&gt;
&#039;&#039;&#039; See: [https://docs.moodle.org/dev/Moodle_2.7_release_notes#Assignment]&lt;br /&gt;
&lt;br /&gt;
Returns all the submitted assignments that still need grading&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
select &lt;br /&gt;
u.firstname AS &amp;quot;First&amp;quot;,&lt;br /&gt;
u.lastname AS &amp;quot;Last&amp;quot;,&lt;br /&gt;
c.fullname AS &amp;quot;Course&amp;quot;,&lt;br /&gt;
a.name AS &amp;quot;Assignment&amp;quot;&lt;br /&gt;
&lt;br /&gt;
from prefix_assignment_submissions as asb&lt;br /&gt;
join prefix_assignment as a ON a.id = asb.assignment&lt;br /&gt;
join prefix_user as u ON u.id = asb.userid&lt;br /&gt;
join prefix_course as c ON c.id = a.course&lt;br /&gt;
join prefix_course_modules as cm ON c.id = cm.course&lt;br /&gt;
&lt;br /&gt;
where asb.grade &amp;lt; 0 and cm.instance = a.id&lt;br /&gt;
and cm.module = 1&lt;br /&gt;
&lt;br /&gt;
order by c.fullname, a.name, u.lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===All Ungraded Assignments w/ Link===&lt;br /&gt;
Returns all assignments submitted by those with the student role that have the status of &#039;submitted&#039;, along with a link that goes directly to the submission to grade it. The links work if you view the report within Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This query is updated for use with Moodle 2.2 or later.  Contributed by Carly J. Born, Carleton College&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
u.firstname AS &amp;quot;First&amp;quot;,&lt;br /&gt;
u.lastname AS &amp;quot;Last&amp;quot;,&lt;br /&gt;
c.fullname AS &amp;quot;Course&amp;quot;,&lt;br /&gt;
a.name AS &amp;quot;Assignment&amp;quot;,&lt;br /&gt;
 &lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/assign/view.php?id=&#039;, &lt;br /&gt;
cm.id, &lt;br /&gt;
&#039;&amp;amp;rownum=0&amp;amp;action=grader&amp;amp;userid=&#039;, &lt;br /&gt;
u.id,&lt;br /&gt;
&#039;&amp;quot;&amp;gt;Grade&amp;lt;/a&amp;gt;&#039;) &lt;br /&gt;
AS &amp;quot;Assignment link&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
FROM prefix_assign_submission sub&lt;br /&gt;
JOIN prefix_assign a ON a.id = sub.assignment&lt;br /&gt;
JOIN prefix_user u ON u.id = sub.userid&lt;br /&gt;
JOIN prefix_course c ON c.id = a.course AND c.id = %%COURSEID%%&lt;br /&gt;
JOIN prefix_course_modules cm ON c.id = cm.course &lt;br /&gt;
JOIN prefix_context cxt ON c.id=cxt.instanceid AND cxt.contextlevel=50&lt;br /&gt;
JOIN prefix_role_assignments ra ON cxt.id = ra.contextid AND ra.roleid=5 AND ra.userid=u.id&lt;br /&gt;
 &lt;br /&gt;
WHERE cm.instance = a.id AND cm.module = 22 AND sub.status=&#039;submitted&#039;&lt;br /&gt;
 &lt;br /&gt;
ORDER BY c.fullname, a.name, u.lastname&lt;br /&gt;
&amp;lt;/code sql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE: This query is for the deprecated old Assignment module from Moodle 2.2, not the new Assignments module. Please update this query if you are the author or it will be removed as the 2.2 Assignment module is no longer supported since release 2.7.&lt;br /&gt;
See: [https://docs.moodle.org/dev/Moodle_2.7_release_notes#Assignment]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Returns all the submitted assignments that still need grading, along with a link that goes directly to the submission to grade it. The links work if you view the report within Moodle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
select &lt;br /&gt;
u.firstname AS &amp;quot;First&amp;quot;,&lt;br /&gt;
u.lastname AS &amp;quot;Last&amp;quot;,&lt;br /&gt;
c.fullname AS &amp;quot;Course&amp;quot;,&lt;br /&gt;
a.name AS &amp;quot;Assignment&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
&#039;&amp;lt;a href=&amp;quot;http://education.varonis.com/mod/assignment/submissions.php&#039; + char(63) +&lt;br /&gt;
+ &#039;id=&#039; + cast(cm.id as varchar) + &#039;&amp;amp;userid=&#039; + cast(u.id as varchar) &lt;br /&gt;
+ &#039;&amp;amp;mode=single&amp;amp;filter=0&amp;amp;offset=2&amp;quot;&amp;gt;&#039; + a.name + &#039;&amp;lt;/a&amp;gt;&#039;&lt;br /&gt;
AS &amp;quot;Assignmentlink&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
from prefix_assignment_submissions as asb&lt;br /&gt;
join prefix_assignment as a ON a.id = asb.assignment&lt;br /&gt;
join prefix_user as u ON u.id = asb.userid&lt;br /&gt;
join prefix_course as c ON c.id = a.course&lt;br /&gt;
join prefix_course_modules as cm ON c.id = cm.course&lt;br /&gt;
&lt;br /&gt;
where asb.grade &amp;lt; 0 and cm.instance = a.id and cm.module = 1&lt;br /&gt;
&lt;br /&gt;
order by c.fullname, a.name, u.lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Assignments (and Quizzes) waiting to be graded===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: This query is for the deprecated old Assignment module from Moodle 2.2, not the new Assignments module. Please update this query if you are the author or it will be removed as the 2.2 Assignment module is no longer supported since release 2.7.&lt;br /&gt;
&#039;&#039;&#039; See: [https://docs.moodle.org/dev/Moodle_2.7_release_notes#Assignment]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This report requires a YEAR filter to be added (Available when using the latest block/configurable_reports)&lt;br /&gt;
&lt;br /&gt;
Which you can always remove, to make this query work on earlier versions.&lt;br /&gt;
&lt;br /&gt;
The report includes: &lt;br /&gt;
*number of quizzes&lt;br /&gt;
*unFinished Quiz attempts&lt;br /&gt;
*Finished Quiz attempts&lt;br /&gt;
*number of students&lt;br /&gt;
*number of Assignments&lt;br /&gt;
*number of submitted answers by students &lt;br /&gt;
*number of unchecked assignments (waiting for the Teacher) in a Course.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
&lt;br /&gt;
,(SELECT CONCAT(u.firstname,&#039; &#039;, u.lastname) AS Teacher&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) AS Teacher &lt;br /&gt;
 &lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/assignment/index.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;מטלות&amp;lt;/a&amp;gt;&#039;) AS Assignments&lt;br /&gt;
&lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/quiz/index.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;בחנים&amp;lt;/a&amp;gt;&#039;) AS &#039;Quizzes&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) &lt;br /&gt;
FROM prefix_course_modules cm &lt;br /&gt;
JOIN prefix_modules as m ON m.id = cm.module &lt;br /&gt;
WHERE m.name LIKE &#039;quiz&#039; AND cm.course = c.id &lt;br /&gt;
GROUP BY cm.course &lt;br /&gt;
) AS &#039;nQuizzes&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*)&lt;br /&gt;
FROM prefix_quiz_attempts AS qa&lt;br /&gt;
JOIN prefix_quiz AS q ON q.id = qa.quiz&lt;br /&gt;
WHERE q.course = c.id&lt;br /&gt;
AND qa.timefinish = 0&lt;br /&gt;
GROUP BY q.course) AS &#039;unFinished Quiz attempts&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*)&lt;br /&gt;
FROM prefix_quiz_attempts AS qa&lt;br /&gt;
JOIN prefix_quiz AS q ON q.id = qa.quiz&lt;br /&gt;
WHERE q.course = c.id&lt;br /&gt;
AND qa.timefinish &amp;gt; 0&lt;br /&gt;
GROUP BY q.course) AS &#039;finished quiz attempts&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
) AS nStudents&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
,(&lt;br /&gt;
SELECT count(a.id)&lt;br /&gt;
FROM prefix_assignment AS a &lt;br /&gt;
JOIN prefix_course_modules AS cm ON a.course = cm.course &lt;br /&gt;
WHERE cm.instance = a.id AND cm.module = 1 AND a.course = c.id&lt;br /&gt;
) nAssignments&lt;br /&gt;
&lt;br /&gt;
,(&lt;br /&gt;
SELECT count(*)&lt;br /&gt;
FROM prefix_assignment AS a &lt;br /&gt;
WHERE a.course = c.id AND FROM_UNIXTIME(a.timedue) &amp;gt; NOW()&lt;br /&gt;
GROUP BY a.course&lt;br /&gt;
) &#039;Open &amp;lt;br/&amp;gt;Assignments&#039;&lt;br /&gt;
&lt;br /&gt;
, CONCAT(ROUND( (100 / iAssignments ) * iOpenAssignments ) ,&#039;%&#039;) &#039;unFinished &amp;lt;br/&amp;gt;Assignments &amp;lt;br/&amp;gt;(percent)&#039;&lt;br /&gt;
 &lt;br /&gt;
,(&lt;br /&gt;
SELECT count(asb.id)&lt;br /&gt;
FROM prefix_assignment_submissions AS asb&lt;br /&gt;
JOIN prefix_assignment AS a ON a.id = asb.assignment&lt;br /&gt;
JOIN prefix_course_modules AS cm ON a.course = cm.course &lt;br /&gt;
WHERE asb.grade &amp;lt; 0 AND cm.instance = a.id AND cm.module = 1 AND a.course = c.id&lt;br /&gt;
) &#039;unChecked  &amp;lt;br/&amp;gt;Submissions&#039; &lt;br /&gt;
 &lt;br /&gt;
,(&lt;br /&gt;
SELECT count(asb.id)&lt;br /&gt;
FROM prefix_assignment_submissions AS asb&lt;br /&gt;
JOIN prefix_assignment AS a ON a.id = asb.assignment&lt;br /&gt;
JOIN prefix_course_modules AS cm ON a.course = cm.course &lt;br /&gt;
WHERE cm.instance = a.id AND cm.module = 1 AND a.course = c.id&lt;br /&gt;
) &#039;Submitted  &amp;lt;br/&amp;gt;Assignments&#039;&lt;br /&gt;
 &lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
LEFT JOIN (&lt;br /&gt;
SELECT course, count(*) AS iAssignments&lt;br /&gt;
FROM prefix_assignment AS a &lt;br /&gt;
GROUP BY a.course &lt;br /&gt;
) AS tblAssignmentsCount ON tblAssignmentsCount.course = c.id&lt;br /&gt;
&lt;br /&gt;
LEFT JOIN (&lt;br /&gt;
SELECT course, count(*) AS iOpenAssignments&lt;br /&gt;
FROM prefix_assignment AS a &lt;br /&gt;
WHERE FROM_UNIXTIME(a.timedue) &amp;gt; NOW()&lt;br /&gt;
GROUP BY a.course &lt;br /&gt;
) AS tblOpenAssignmentsCount ON tblOpenAssignmentsCount.course = c.id&lt;br /&gt;
&lt;br /&gt;
WHERE 1=1  &lt;br /&gt;
#AND c.fullname LIKE &#039;%תשעג%&#039;&lt;br /&gt;
%%FILTER_YEARS:c.fullname%%&lt;br /&gt;
## You can enable the SEMESTER filter as well, &lt;br /&gt;
## by uncommenting the following line:&lt;br /&gt;
## %%FILTER_SEMESTERS:c.fullname%%&lt;br /&gt;
ORDER BY &#039;Open &amp;lt;br/&amp;gt;Assignments&#039; DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Rubrics without zero values in criteria===&lt;br /&gt;
Contributed by Eric Strom&lt;br /&gt;
&lt;br /&gt;
Rubric calculations in Moodle can fail to align with instructors expectations if they lack a zero value for each criterion used in the assessment. From documentation at https://docs.moodle.org/32/en/Rubrics#Grade_calculation:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;For example, when the teacher in the previous example chose both levels with 1 point, the plain sum would be 2 points. But that is actually the lowest possible score so it maps to the grade 0 in Moodle.&lt;br /&gt;
TIP: To avoid confusion from this sort of thing, we recommend including a level with 0 points in every rubric criterion.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This report identifies rubrics having criteria without a zero value level and the courses they live in. This also refines to only assignments with active rubrics that are visible to students in the course. Links to the each rubric id is the direct link to edit the rubric. Fix by adding a zero level for each criteria that is missing it. In general, the grading changes that result will be in the students&#039; favor.&lt;br /&gt;
&lt;br /&gt;
Includes search filter of course idnumber.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT cat.name AS Department, concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php&#039;,CHAR(63),&#039;id=&#039;,&lt;br /&gt;
c.id,&#039;&amp;quot;&amp;gt;&#039;,c.idnumber,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course_ID, &lt;br /&gt;
c.fullname AS Course_Name, &lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/grade/grading/form/rubric/edit.php&#039;,CHAR(63),&#039;areaid=&#039;,gd.areaid,&#039;&amp;quot;&amp;gt;&#039;,gd.areaid,&#039;&amp;lt;/a&amp;gt;&#039;) AS Rubric&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_course_categories AS cat &lt;br /&gt;
ON cat.id = c.category&lt;br /&gt;
JOIN prefix_course_modules AS cm &lt;br /&gt;
ON c.id=cm.course&lt;br /&gt;
JOIN prefix_context AS ctx &lt;br /&gt;
ON cm.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_grading_areas AS garea &lt;br /&gt;
ON ctx.id = garea.contextid&lt;br /&gt;
JOIN prefix_grading_definitions AS gd &lt;br /&gt;
ON garea.id = gd.areaid&lt;br /&gt;
JOIN prefix_gradingform_rubric_criteria AS crit &lt;br /&gt;
ON gd.id = crit.definitionid&lt;br /&gt;
JOIN prefix_gradingform_rubric_levels AS levels &lt;br /&gt;
ON levels.criterionid = crit.id&lt;br /&gt;
WHERE cm.visible=&#039;1&#039; AND garea.activemethod = &#039;rubric&#039; AND (crit.id NOT IN&lt;br /&gt;
(SELECT crit.id&lt;br /&gt;
FROM prefix_gradingform_rubric_criteria AS crit&lt;br /&gt;
JOIN prefix_gradingform_rubric_levels AS levels &lt;br /&gt;
ON levels.criterionid = crit.id WHERE levels.score = &#039;0&#039;))&lt;br /&gt;
&lt;br /&gt;
GROUP BY Rubric&lt;br /&gt;
ORDER BY Course_ID, Rubric&lt;br /&gt;
&lt;br /&gt;
%%FILTER_SEARCHTEXT:c.idnumber:~%%&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Who is using &amp;quot;Single File Upload&amp;quot; assignment===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
 &lt;br /&gt;
,(SELECT CONCAT(u.firstname,&#039; &#039;, u.lastname) AS Teacher&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) AS Teacher &lt;br /&gt;
&lt;br /&gt;
,ass.name as &amp;quot;Assignment Name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM &lt;br /&gt;
prefix_assignment as ass&lt;br /&gt;
&lt;br /&gt;
JOIN &lt;br /&gt;
prefix_course as c ON c.id = ass.course&lt;br /&gt;
&lt;br /&gt;
WHERE `assignmenttype` LIKE &#039;uploadsingle&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Feedback Module Reports==&lt;br /&gt;
===List the answers to all the Feedback activities within the current course, submitted by the current user===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT /* crs.fullname as &amp;quot;Course name&amp;quot;, f.name AS &amp;quot;Journal name&amp;quot;, CONCAT(u.firstname,&#039; &#039;,UPPER(u.lastname)) as &amp;quot;Participant&amp;quot;, */ /* include these fields if you want to check the composition of the recordset */&lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(c.timemodified),&#039;%W %e %M, %Y&#039;) as &amp;quot;Answer Date&amp;quot;,&lt;br /&gt;
CASE i.typ WHEN &#039;label&#039; THEN i.presentation ELSE i.name END as &amp;quot;Topic&amp;quot;,  /* usually labels are used as section titles, so you&#039;d want them present in the recordset */&lt;br /&gt;
v.value as &amp;quot;My Answer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_feedback AS f&lt;br /&gt;
INNER JOIN prefix_course as crs on crs.id=f.course %%FILTER_COURSES:f.course%% &lt;br /&gt;
INNER JOIN prefix_feedback_item AS i ON f.id=i.feedback&lt;br /&gt;
INNER JOIN prefix_feedback_completed AS c on f.id=c.feedback %%FILTER_COURSEUSER:c.userid%% &lt;br /&gt;
LEFT JOIN prefix_feedback_value AS v on v.completed=c.id AND v.item=i.id&lt;br /&gt;
INNER JOIN prefix_user AS u on c.userid=u.id&lt;br /&gt;
&lt;br /&gt;
WHERE c.id = %%COURSEID%% AND u.id = %%USERID%%  AND c.anonymous_response = 1  /* This clause limits the recordset to the current course and the current user and includes/ excludes the anonymous responses as needed */&lt;br /&gt;
&lt;br /&gt;
ORDER BY f.id, c.timemodified, i.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Show all Feedbacks from all courses for all users including showing names of anonymous users===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
Shows all Feedbacks in all Courses with all multi-choice questions including showing the username of anonymous users. Also shows truly anonymous users on the front page as &#039;Not-logged-in&#039; users. This is a rough report, not a pretty report, and is limited to multiple-choice type questions, but is shows the answer number and the list of possible answers in raw form. I post it here as a basis for further reports, and also as away to get the identities of anonymous users if needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
c.shortname AS Course, &lt;br /&gt;
f.name AS Feedback,&lt;br /&gt;
# i.id AS Itemid,&lt;br /&gt;
i.name AS Itemname,&lt;br /&gt;
i.label AS Itemlabel,&lt;br /&gt;
CASE &lt;br /&gt;
 WHEN f.anonymous = 1 AND u.id != 0 THEN CONCAT(u.username, &#039; :ANON&#039;)&lt;br /&gt;
 WHEN fc.userid = 0 THEN &#039;Not-logged-in&#039;&lt;br /&gt;
 ELSE u.username&lt;br /&gt;
END AS &#039;User&#039;,&lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(fc.timemodified),&#039;%Y-%m-%d %H:%i&#039;) AS &amp;quot;Completed&amp;quot;,&lt;br /&gt;
v.value AS &amp;quot;Choice&amp;quot;,&lt;br /&gt;
CASE &lt;br /&gt;
 WHEN i.typ = &#039;multichoice&#039; THEN&lt;br /&gt;
     IF (  SUBSTRING(i.presentation,1,6)=&#039;r&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&#039;,&lt;br /&gt;
	       SUBSTRING(i.presentation,7),&lt;br /&gt;
		   i.presentation)&lt;br /&gt;
 ELSE i.presentation&lt;br /&gt;
END AS &amp;quot;Answers&amp;quot;,&lt;br /&gt;
i.typ,&lt;br /&gt;
i.dependitem,&lt;br /&gt;
i.dependvalue&lt;br /&gt;
&lt;br /&gt;
FROM prefix_feedback f&lt;br /&gt;
JOIN prefix_course c ON c.id=f.course &lt;br /&gt;
JOIN prefix_feedback_item AS i ON f.id=i.feedback&lt;br /&gt;
JOIN prefix_feedback_completed fc ON f.id=fc.feedback&lt;br /&gt;
LEFT JOIN prefix_feedback_value v ON v.completed=fc.id AND v.item=i.id&lt;br /&gt;
LEFT JOIN prefix_user AS u ON fc.userid=u.id&lt;br /&gt;
WHERE i.typ != &#039;pagebreak&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Show all Feedbacks from all courses for all users with their answers===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
Shows all Feedbacks in all Courses with all multi-choice questions and answers of all users for multi-choice questions. It shows the possible answers, the number of the chosen answer and the text of the chosen answer by the user. As always, I disavow any prettiness here and you should update the fields as you need.&lt;br /&gt;
&lt;br /&gt;
Known to work in Moodle 3.5 to 3.10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
c.fullname as &amp;quot;Course&amp;quot;, &lt;br /&gt;
f.name AS &amp;quot;Feedback&amp;quot;, &lt;br /&gt;
CONCAT(u.firstname,&#039;  &#039;,u.lastname) as &amp;quot;User&amp;quot;,&lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(fc.timemodified), &#039;%Y-%m-%d %H:%i&#039;) AS &amp;quot;When&amp;quot;,&lt;br /&gt;
IF(i.typ = &#039;label&#039;, i.presentation, i.name) AS &amp;quot;Question&amp;quot;, &lt;br /&gt;
# answers presentation string starts with these 6 characters:  r&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;
CASE WHEN i.typ = &#039;multichoice&#039; THEN SUBSTRING(i.presentation,7) END AS &amp;quot;Possible Answers&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
CASE i.typ WHEN &#039;multichoice&#039; THEN v.value ELSE &#039;-&#039; END AS &amp;quot;Chosen Answer Num&amp;quot;,&lt;br /&gt;
CASE v.value&lt;br /&gt;
  WHEN 1 THEN SUBSTRING(i.presentation, 7, POSITION(&#039;|&#039; IN i.presentation) - 7) &lt;br /&gt;
  WHEN 2 THEN SUBSTRING_INDEX(SUBSTRING_INDEX(i.presentation, &#039;|&#039;,2), &#039;|&#039;,-1)&lt;br /&gt;
  WHEN 3 THEN SUBSTRING_INDEX(SUBSTRING_INDEX(i.presentation, &#039;|&#039;,3), &#039;|&#039;,-1)&lt;br /&gt;
  WHEN 4 THEN SUBSTRING_INDEX(SUBSTRING_INDEX(i.presentation, &#039;|&#039;,4), &#039;|&#039;,-1)&lt;br /&gt;
  WHEN 5 THEN SUBSTRING_INDEX(SUBSTRING_INDEX(i.presentation, &#039;|&#039;,5), &#039;|&#039;,-1)&lt;br /&gt;
  WHEN 6 THEN SUBSTRING_INDEX(SUBSTRING_INDEX(i.presentation, &#039;|&#039;,6), &#039;|&#039;,-1)&lt;br /&gt;
  WHEN 7 THEN SUBSTRING_INDEX(SUBSTRING_INDEX(i.presentation, &#039;|&#039;,7), &#039;|&#039;,-1)&lt;br /&gt;
  WHEN 8 THEN SUBSTRING_INDEX(SUBSTRING_INDEX(i.presentation, &#039;|&#039;,8), &#039;|&#039;,-1)&lt;br /&gt;
  WHEN 9 THEN SUBSTRING_INDEX(SUBSTRING_INDEX(i.presentation, &#039;|&#039;,9), &#039;|&#039;,-1) &lt;br /&gt;
  ELSE CONCAT(&amp;quot;More:&amp;quot;, v.value)&lt;br /&gt;
END AS &amp;quot;Chosen Answer Text&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
FROM prefix_feedback AS f&lt;br /&gt;
JOIN prefix_course AS c ON c.id=f.course&lt;br /&gt;
JOIN prefix_feedback_item AS i ON f.id=i.feedback&lt;br /&gt;
JOIN prefix_feedback_completed AS fc ON f.id=fc.feedback &lt;br /&gt;
LEFT JOIN prefix_feedback_value AS v ON v.completed=fc.id AND v.item=i.id&lt;br /&gt;
JOIN prefix_user AS u ON fc.userid=u.id&lt;br /&gt;
&lt;br /&gt;
WHERE i.typ IN (&#039;label&#039;, &#039;multichoice&#039;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resource Module Reports==&lt;br /&gt;
===List &amp;quot;Recently uploaded files&amp;quot;===&lt;br /&gt;
see what users are uploading&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT FROM_UNIXTIME(time,&#039;%Y %M %D %h:%i:%s&#039;) as time ,ip,userid,url,info  &lt;br /&gt;
FROM `prefix_log` &lt;br /&gt;
WHERE `action` LIKE &#039;upload&#039; &lt;br /&gt;
ORDER BY `prefix_log`.`time`  DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List Courses that loaded a specific file: &amp;quot;X&amp;quot;===&lt;br /&gt;
Did the Teacher (probably) uploaded course&#039;s Syllabus ?&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.id, c.fullname  FROM `prefix_log` as l &lt;br /&gt;
JOIN prefix_course as c ON c.id = l.course &lt;br /&gt;
WHERE `action` LIKE &#039;%upload%&#039; AND ( info LIKE &#039;%Syllabus%&#039; OR info LIKE &#039;%Sylabus%&#039; ) GROUP BY c.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===All resources that link to some specific external website===&lt;br /&gt;
+ link to course&lt;br /&gt;
+ who&#039;s the teacher&lt;br /&gt;
+ link to external resource&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
,c.shortname,r.name&lt;br /&gt;
,(SELECT CONCAT(u.firstname,&#039; &#039;, u.lastname) AS Teacher&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) AS Teacher&lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/resource/view.php?id=&#039;,r.id,&#039;&amp;quot;&amp;gt;&#039;,r.name,&#039;&amp;lt;/a&amp;gt;&#039;) AS Resource&lt;br /&gt;
FROM prefix_resource AS r &lt;br /&gt;
JOIN prefix_course AS c ON r.course = c.id&lt;br /&gt;
WHERE r.reference LIKE &#039;http://info.oranim.ac.il/home%&#039; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;Compose Web Page&amp;quot; RESOURCE count===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT course,prefix_course.fullname, COUNT(*) AS Total&lt;br /&gt;
FROM `prefix_resource`&lt;br /&gt;
JOIN `prefix_course` ON prefix_course.id = prefix_resource.course&lt;br /&gt;
WHERE type=&#039;html&#039;&lt;br /&gt;
GROUP BY course&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Resource count in courses===&lt;br /&gt;
+ (First)Teacher name&lt;br /&gt;
+ Where course is inside some specific Categories&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
COUNT(*) AS count&lt;br /&gt;
,r.course &lt;br /&gt;
,c.shortname shortname&lt;br /&gt;
,c.fullname coursename&lt;br /&gt;
,( SELECT DISTINCT CONCAT(u.firstname,&#039; &#039;,u.lastname)&lt;br /&gt;
  FROM prefix_role_assignments AS ra&lt;br /&gt;
  JOIN prefix_user as u ON ra.userid = u.id&lt;br /&gt;
  JOIN prefix_context AS ctx ON ctx.id = ra.contextid&lt;br /&gt;
  WHERE ra.roleid = 3 AND ctx.instanceid = r.course AND ctx.contextlevel = 50 LIMIT 1) AS Teacher&lt;br /&gt;
FROM prefix_resource r &lt;br /&gt;
JOIN prefix_course c ON r.course = c.id&lt;br /&gt;
WHERE c.category IN (10,13,28,18,26)&lt;br /&gt;
GROUP BY r.course&lt;br /&gt;
ORDER BY COUNT(*) DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Delete all the automated backup files===&lt;br /&gt;
Prepare bash cli script to delete all the automated backup files on the file system. (clean up some disk space)&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT CONCAT( &#039;rm -f /var/moodledatanew/filedir/&#039;, SUBSTRING( contenthash, 1, 2 ) , &#039;/&#039;, SUBSTRING( contenthash, 3, 2 ) , &#039;/&#039;, contenthash ) &lt;br /&gt;
FROM `mdl_files` &lt;br /&gt;
WHERE `filename` LIKE &#039;%mbz%&#039;&lt;br /&gt;
AND filearea = &#039;automated&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Find out how much disk space is used by all automated backup files:&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT SUM(filesize)/(1024*1024*1024) FROM `mdl_files` WHERE  `filename` LIKE &#039;%mbz%&#039; AND filearea =  &#039;automated&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Forum Module Reports==&lt;br /&gt;
===print all User&#039;s post in course Forums===&lt;br /&gt;
%%COURSEID%% is a variable the is replace by the current CourseID you are running the sql report from. if you are using the latest block/configurable_reports ! (You can always change it to a fixed course or remove it to display all courses.)&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/forum/user.php?course=&#039;,c.id,&#039;&amp;amp;id=&#039;,u.id,&#039;&amp;amp;mode=posts&amp;quot;&amp;gt;&#039;,CONCAT(u.firstname,&#039; &#039;, u.lastname),&#039;&amp;lt;/a&amp;gt;&#039;) As Fullname&lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/forum/view.php?f=&#039;,fd.forum,&#039;&amp;quot;&amp;gt;&#039;,f.name,&#039;&amp;lt;/a&amp;gt;&#039;) AS Forum&lt;br /&gt;
,count(*) as Posts&lt;br /&gt;
,(SELECT count(*) FROM prefix_forum_discussions AS ifd JOIN prefix_forum as iforum ON iforum.id = ifd.forum  WHERE ifd.userid = fp.userid AND iforum.id = f.id) AS cAllDiscussion&lt;br /&gt;
&lt;br /&gt;
FROM prefix_forum_posts AS fp &lt;br /&gt;
JOIN prefix_user as u ON u.id = fp.userid &lt;br /&gt;
JOIN prefix_forum_discussions AS fd ON fp.discussion = fd.id &lt;br /&gt;
JOIN prefix_forum AS f ON f.id = fd.forum &lt;br /&gt;
JOIN prefix_course as c ON c.id = fd.course &lt;br /&gt;
WHERE fd.course = %%COURSEID%% &lt;br /&gt;
GROUP BY f.id,u.id&lt;br /&gt;
ORDER BY u.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FORUM use Count per COURSE -- not including NEWS Forum!===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT prefix_course.fullname, prefix_forum.course, count(*) as total FROM prefix_forum&lt;br /&gt;
INNER JOIN prefix_course&lt;br /&gt;
ON prefix_course.id = prefix_forum.course&lt;br /&gt;
WHERE NOT(prefix_forum.type = &#039;news&#039;)&lt;br /&gt;
GROUP BY prefix_forum.course&lt;br /&gt;
ORDER BY total desc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FORUM use Count per COURSE by type -- not including NEWS Forum!===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT prefix_course.fullname, prefix_forum.course, prefix_forum.type, count(*) as total FROM prefix_forum&lt;br /&gt;
INNER JOIN prefix_course&lt;br /&gt;
ON prefix_course.id = prefix_forum.course&lt;br /&gt;
WHERE NOT(prefix_forum.type = &#039;news&#039;)&lt;br /&gt;
GROUP BY prefix_forum.course,prefix_forum.type&lt;br /&gt;
ORDER BY total desc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forum activity - system wide===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.id,&#039;&amp;lt;/a&amp;gt;&#039;) AS CourseID&lt;br /&gt;
,( SELECT DISTINCT CONCAT(u.firstname,&#039; &#039;,u.lastname)&lt;br /&gt;
  FROM prefix_role_assignments AS ra&lt;br /&gt;
  JOIN prefix_user AS u ON ra.userid = u.id&lt;br /&gt;
  JOIN prefix_context AS ctx ON ctx.id = ra.contextid&lt;br /&gt;
  WHERE ra.roleid = 3 AND ctx.instanceid = c.id AND ctx.contextlevel = 50 LIMIT 1) AS Teacher&lt;br /&gt;
,c.fullname as Course&lt;br /&gt;
,f.type&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5 AND ctx.instanceid = c.id) AS Students&lt;br /&gt;
, fd.forum, f.name,count(*) AS cPostAndDisc&lt;br /&gt;
,(SELECT count(*) FROM prefix_forum_discussions AS ifd WHERE ifd.forum = f.id) AS cDiscussion&lt;br /&gt;
FROM prefix_forum_posts AS fp&lt;br /&gt;
JOIN prefix_forum_discussions AS fd ON fd.id = fp.discussion&lt;br /&gt;
JOIN prefix_forum AS f ON f.id = fd.forum&lt;br /&gt;
JOIN prefix_course AS c ON c.id = f.course&lt;br /&gt;
WHERE f.type != &#039;news&#039; AND c.fullname LIKE &#039;%2013%&#039;&lt;br /&gt;
## WHERE 1=1 &lt;br /&gt;
## %%FILTER_YEARS:c.fullname%%&lt;br /&gt;
## You can enable the SEMESTER filter as well, &lt;br /&gt;
## by uncommenting the following line:&lt;br /&gt;
## %%FILTER_SEMESTERS:c.fullname%%&lt;br /&gt;
&lt;br /&gt;
GROUP BY fd.forum&lt;br /&gt;
ORDER BY count( * ) DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Activity In Forums===&lt;br /&gt;
Trying to figure out how much real activity we have in Forums by aggregating:&lt;br /&gt;
Users in Course, Number of Posts, Number of Discussions, Unique student post, Unique student discussions, Number of Teachers , Number of Students, ratio between unique Student posts and the number of students in the Course...&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.fullname,f.name,f.type &lt;br /&gt;
,(SELECT count(id) FROM prefix_forum_discussions as fd WHERE f.id = fd.forum) as Discussions&lt;br /&gt;
,(SELECT count(distinct fd.userid) FROM prefix_forum_discussions as fd WHERE fd.forum = f.id) as UniqueUsersDiscussions&lt;br /&gt;
,(SELECT count(fp.id) FROM prefix_forum_discussions fd JOIN prefix_forum_posts as fp ON fd.id = fp.discussion WHERE f.id = fd.forum) as Posts&lt;br /&gt;
,(SELECT count(distinct fp.userid) FROM prefix_forum_discussions fd JOIN prefix_forum_posts as fp ON fd.id = fp.discussion WHERE f.id = fd.forum) as UniqueUsersPosts&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Students&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid =5&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
) AS StudentsCount&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Teachers&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid =3&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
) AS &#039;Teacher&amp;lt;br/&amp;gt;Count&#039;&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid IN (3,5)&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
) AS UserCount&lt;br /&gt;
, (SELECT (UniqueUsersDiscussions / StudentsCount )) as StudentDissUsage&lt;br /&gt;
, (SELECT (UniqueUsersPosts /StudentsCount)) as StudentPostUsage&lt;br /&gt;
FROM prefix_forum as f &lt;br /&gt;
JOIN prefix_course as c ON f.course = c.id&lt;br /&gt;
WHERE `type` != &#039;news&#039;&lt;br /&gt;
ORDER BY StudentPostUsage DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===All Forum type:NEWS===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT f.id, f.name&lt;br /&gt;
FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
JOIN prefix_forum AS f ON cm.instance = f.id&lt;br /&gt;
WHERE m.name = &#039;forum&#039;&lt;br /&gt;
AND f.type = &#039;news&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===All new forum NEWS items (discussions) from all my Courses===&lt;br /&gt;
change &amp;quot;userid = 26&amp;quot; and &amp;quot;id = 26&amp;quot; to a new user id&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.shortname,f.name,fd.name,FROM_UNIXTIME(fd.timemodified ,&amp;quot;%d %M %Y &amp;quot;) as Date&lt;br /&gt;
FROM prefix_forum_discussions as fd &lt;br /&gt;
JOIN prefix_forum as f ON f.id = fd.forum &lt;br /&gt;
JOIN prefix_course as c ON c.id = f.course &lt;br /&gt;
JOIN prefix_user_lastaccess as ul ON (c.id = ul.courseid AND ul.userid = 26)&lt;br /&gt;
WHERE fd.timemodified &amp;gt; ul.timeaccess  &lt;br /&gt;
 AND fd.forum IN (SELECT f.id&lt;br /&gt;
 FROM prefix_course_modules AS cm&lt;br /&gt;
 JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
 JOIN prefix_forum AS f ON cm.instance = f.id&lt;br /&gt;
 WHERE m.name = &#039;forum&#039;&lt;br /&gt;
 AND f.type = &#039;news&#039;)&lt;br /&gt;
  AND c.id IN (SELECT c.id&lt;br /&gt;
   FROM prefix_course AS c&lt;br /&gt;
   JOIN prefix_context AS ctx ON c.id = ctx.instanceid&lt;br /&gt;
   JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id&lt;br /&gt;
   JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
   WHERE u.id = 26) ORDER BY `fd`.`timemodified` DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===News Forum - Discussions COUNT===&lt;br /&gt;
Which is actually... How much instructions students get from their teachers&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.shortname ,&lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
,( SELECT DISTINCT CONCAT(u.firstname,&#039; &#039;,u.lastname)&lt;br /&gt;
  FROM prefix_role_assignments AS ra&lt;br /&gt;
  JOIN prefix_user AS u ON ra.userid = u.id&lt;br /&gt;
  JOIN prefix_context AS ctx ON ctx.id = ra.contextid&lt;br /&gt;
  WHERE ra.roleid = 3 AND ctx.instanceid = c.id AND ctx.contextlevel = 50 LIMIT 1) AS Teacher&lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/forum/view.php?f=&#039;,fd.forum,&#039;&amp;quot;&amp;gt;&#039;,count(fd.id),&#039;&amp;lt;/a&amp;gt;&#039;) AS DiscussionsSum&lt;br /&gt;
FROM prefix_forum_discussions AS fd&lt;br /&gt;
INNER JOIN prefix_forum AS f ON f.id = fd.forum&lt;br /&gt;
INNER JOIN prefix_course AS c ON c.id = f.course&lt;br /&gt;
WHERE f.type = &#039;news&#039; AND c.category IN (10,13,28,18,26)&lt;br /&gt;
GROUP BY fd.forum&lt;br /&gt;
ORDER BY count(fd.id) DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Cantidad de foros que han sido posteados por profesor===&lt;br /&gt;
&lt;br /&gt;
(Number of forums that have been posted by teacher/Google translator)&lt;br /&gt;
&lt;br /&gt;
Queriamos saber cuales son las acciones del profesor dentro de los foros de cada curso, por ello se hizo este informe.&lt;br /&gt;
&lt;br /&gt;
(We wanted to know what the teacher&#039;s actions are in the forums of each course, so this report was made. /Google translator)&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.shortname,&#039;&amp;lt;/a&amp;gt;&#039;) AS curso,&lt;br /&gt;
CONCAT(u.firstname ,&#039; &#039;,u.lastname) AS Facilitador,&lt;br /&gt;
&lt;br /&gt;
(SELECT COUNT( m.name ) AS COUNT FROM &lt;br /&gt;
prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%forum%&#039;) AS foros,&lt;br /&gt;
&lt;br /&gt;
COUNT(*) AS Posts&lt;br /&gt;
&lt;br /&gt;
FROM prefix_forum_posts AS fp &lt;br /&gt;
JOIN prefix_forum_discussions AS fd ON fp.discussion = fd.id &lt;br /&gt;
JOIN prefix_forum AS f ON f.id = fd.forum &lt;br /&gt;
JOIN prefix_course AS c ON c.id = fd.course&lt;br /&gt;
JOIN prefix_user AS u ON u.id = fp.userid &lt;br /&gt;
&lt;br /&gt;
WHERE fp.userid =&lt;br /&gt;
(&lt;br /&gt;
select distinct prefix_user.id&lt;br /&gt;
from prefix_user &lt;br /&gt;
join prefix_role_assignments as ra on ra.userid = prefix_user.id &lt;br /&gt;
where ra.roleid = 3 &lt;br /&gt;
and userid = fp.userid&lt;br /&gt;
limit 1&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
and c.shortname like &#039;%2014-2-1%&#039;&lt;br /&gt;
GROUP BY c.id, u.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===List all the Posts in all the Forums that got high rating===&lt;br /&gt;
We setup a scale that let teachers and students Rate forum post with &amp;quot;Important, interesting, valuable, not rated&amp;quot; scale&lt;br /&gt;
And then add a link to the following report at the begining of the course &amp;quot;Link to all interesting posts&amp;quot;&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/forum/view.php?f=&#039;,f.id,&#039;&amp;quot;&amp;gt;&#039;,f.name,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Forum name,&lt;br /&gt;
CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/forum/discuss.php?d=&#039;,fd.id,&#039;#p&#039;,fp.id,&#039;&amp;quot;&amp;gt;&#039;,fp.subject,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Post link&#039;,&lt;br /&gt;
SUM(r.rating) AS &#039;Rating&#039;&lt;br /&gt;
FROM mdl_rating AS r&lt;br /&gt;
  JOIN mdl_forum_posts AS fp ON fp.id = r.itemid&lt;br /&gt;
  JOIN mdl_forum_discussions AS fd ON fd.id = fp.discussion&lt;br /&gt;
  JOIN mdl_forum AS f ON f.id = fd.forum&lt;br /&gt;
WHERE r.component = &#039;mod_forum&#039; AND r.ratingarea = &#039;post&#039; AND f.course = %%COURSEID%%&lt;br /&gt;
GROUP BY r.itemid&lt;br /&gt;
ORDER BY SUM(r.rating) DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List all the Posts in all Discussions of a single Forum===&lt;br /&gt;
This report is used to help export all the student&#039;s posts and discussions of a single forum, by passing the context module id as a parameter to the report using &amp;quot;&amp;amp;filter_var=cmid&amp;quot;&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/forum/view.php?f=&#039;, f.id, &#039;&amp;quot;&amp;gt;&#039;, f.name, &#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Forum name&#039;,&lt;br /&gt;
fd.name AS &#039;Discussion&#039;, &lt;br /&gt;
CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/forum/discuss.php?d=&#039;, fd.id, &#039;#p&#039;, fp.id, &#039;&amp;quot;&amp;gt;&#039;, fp.subject, &#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Post (link)&#039;,&lt;br /&gt;
fp.message&lt;br /&gt;
&lt;br /&gt;
FROM mdl_forum_posts AS fp &lt;br /&gt;
  JOIN mdl_forum_discussions AS fd ON fd.id = fp.discussion&lt;br /&gt;
  JOIN mdl_forum AS f ON f.id = fd.forum&lt;br /&gt;
  JOIN mdl_course_modules AS cm ON cm.module = 9 AND cm.instance = f.id&lt;br /&gt;
WHERE cm.id = %%FILTER_VAR%%&lt;br /&gt;
ORDER BY f.id, fd.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Quiz Module Reports==&lt;br /&gt;
===Generate a list of instructors and their email addresses for those courses that has &amp;quot;essay questions&amp;quot; in their quizzes===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT qu.id AS quiz_id, qu.course AS course_id, qu.questions,&lt;br /&gt;
                co.fullname AS course_fullname, co.shortname AS course_shortname,&lt;br /&gt;
                qu.name AS quiz_name, FROM_UNIXTIME(qu.timeopen) AS quiz_timeopen, FROM_UNIXTIME(qu.timeclose) AS quiz_timeclose,&lt;br /&gt;
                u.firstname, u.lastname, u.email,&lt;br /&gt;
FROM prefix_quiz qu, prefix_course co, prefix_role re, prefix_context ct, prefix_role_assignments ra, prefix_user u&lt;br /&gt;
WHERE FROM_UNIXTIME(timeopen) &amp;gt; &#039;2008-05-14&#039; AND&lt;br /&gt;
                qu.course = co.id AND&lt;br /&gt;
                co.id = ct.instanceid AND&lt;br /&gt;
                ra.roleid = re.id AND&lt;br /&gt;
                re.name = &#039;Teacher&#039; AND&lt;br /&gt;
                ra.contextid = ct.id AND&lt;br /&gt;
                ra.userid = u.id&lt;br /&gt;
 &lt;br /&gt;
SELECT Count(&#039;x&#039;) As NumOfStudents&lt;br /&gt;
                                FROM prefix_role_assignments a&lt;br /&gt;
                                JOIN prefix_user u ON userid = u.id&lt;br /&gt;
                                WHERE roleid = 5 AND contextid = (SELECT id FROM prefix_context WHERE instanceid = 668 AND contextlevel = 50)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Number of Quizes per Course===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT count(*)&lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/quiz/index.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;Link&amp;lt;/a&amp;gt;&#039;) AS Quizes&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course_modules cm&lt;br /&gt;
JOIN prefix_course c ON c.id = cm.course&lt;br /&gt;
JOIN prefix_modules as m ON m.id = cm.module&lt;br /&gt;
WHERE m.name LIKE &#039;quiz&#039;&lt;br /&gt;
GROUP BY c.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List all MultiAnswer (Cloze) Questions===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/quiz/attempt.php?q=&#039;, quiz.id, &#039;&amp;quot;&amp;gt;&#039;, quiz.name, &#039;&amp;lt;/a&amp;gt;&#039;) AS Quiz&lt;br /&gt;
,question.id question_id, question.questiontext &lt;br /&gt;
FROM  prefix_question question&lt;br /&gt;
JOIN prefix_quiz_question_instances qqi ON question.id = qqi.question&lt;br /&gt;
JOIN prefix_quiz quiz ON qqi.quiz = quiz.id&lt;br /&gt;
WHERE  `qtype` LIKE  &#039;multianswer&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List courses with MANUAL grades===&lt;br /&gt;
Which is basically and indication to teachers using Moodle to hold offline grades inside Moodle&#039;s Gradebook,&lt;br /&gt;
So grades could be uploaded into an administrative SIS. Use with Configurable Reports.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT COUNT( * )&lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/grade/edit/tree/index.php?showadvanced=1&amp;amp;id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
FROM  prefix_grade_items AS gi&lt;br /&gt;
JOIN prefix_course as c ON c.id = gi.courseid&lt;br /&gt;
WHERE  `itemtype` =  &#039;manual&#039;&lt;br /&gt;
GROUP BY courseid&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
===List the users that did not took the Quiz===&lt;br /&gt;
Do not forget to change &amp;quot;c.id = 14&amp;quot; and q.name LIKE &#039;%quiz name goes here%&#039;&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
user2.id AS ID,&lt;br /&gt;
ul.timeaccess,&lt;br /&gt;
user2.firstname AS Firstname,&lt;br /&gt;
user2.lastname AS Lastname,&lt;br /&gt;
user2.email AS Email,&lt;br /&gt;
user2.username AS IDNumber,&lt;br /&gt;
user2.institution AS Institution,&lt;br /&gt;
 &lt;br /&gt;
IF (user2.lastaccess = 0,&#039;never&#039;,&lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(user2.lastaccess),&#039;%Y-%m-%d&#039;)) AS dLastAccess&lt;br /&gt;
 &lt;br /&gt;
,(SELECT DATE_FORMAT(FROM_UNIXTIME(timeaccess),&#039;%Y-%m-%d&#039;) FROM prefix_user_lastaccess WHERE userid=user2.id AND courseid=c.id) AS CourseLastAccess&lt;br /&gt;
 &lt;br /&gt;
,(SELECT r.name&lt;br /&gt;
FROM  prefix_user_enrolments AS uenrol&lt;br /&gt;
JOIN prefix_enrol AS e ON e.id = uenrol.enrolid&lt;br /&gt;
JOIN prefix_role AS r ON e.id = r.id&lt;br /&gt;
WHERE uenrol.userid=user2.id AND e.courseid = c.id) AS RoleName&lt;br /&gt;
 &lt;br /&gt;
FROM prefix_user_enrolments AS ue&lt;br /&gt;
JOIN prefix_enrol AS e ON e.id = ue.enrolid&lt;br /&gt;
JOIN prefix_course AS c ON c.id = e.courseid&lt;br /&gt;
JOIN prefix_user AS user2 ON user2 .id = ue.userid&lt;br /&gt;
LEFT JOIN prefix_user_lastaccess AS ul ON ul.userid = user2.id&lt;br /&gt;
WHERE c.id=14 and ue.userid NOT IN (SELECT qa.userid FROM prefix_quiz_attempts AS qa&lt;br /&gt;
JOIN prefix_quiz AS q ON qa.quiz = q.id&lt;br /&gt;
JOIN prefix_course AS c ON q.course = c.id&lt;br /&gt;
WHERE c.id = 14 AND q.name LIKE &#039;%quiz name goes here%&#039;)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===List Questions in each Quiz===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT quiz.id,quiz.name, q.id, q.name&lt;br /&gt;
FROM mdl_quiz AS quiz&lt;br /&gt;
JOIN mdl_question AS q ON FIND_IN_SET(q.id, quiz.questions)&lt;br /&gt;
WHERE quiz.course = %%COURSEID%%&lt;br /&gt;
ORDER BY quiz.id ASC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: this query does not work in Moodle 2.8+. There is no mdl_quiz.questions field. It will need to be rewritten to use the usage/contextid organization.&lt;br /&gt;
&lt;br /&gt;
Here is a version for Moodle 3.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT cm.id &#039;cmid&#039;, quiz.id &#039;quiz id&#039;&lt;br /&gt;
,CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/quiz/edit.php?cmid=&#039;, &lt;br /&gt;
	   cm.id, &#039;&amp;quot;&amp;gt;&#039;, quiz.name, &#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;edit quiz&#039;&lt;br /&gt;
,q.id &#039;qid&#039;, q.name &#039;question name&#039;&lt;br /&gt;
FROM mdl_quiz AS quiz&lt;br /&gt;
JOIN mdl_course_modules cm ON cm.instance = quiz.id AND cm.module = 33 # 33=quiz mdl_modules&lt;br /&gt;
JOIN mdl_quiz_slots qs ON qs.quizid = quiz.id &lt;br /&gt;
JOIN mdl_question AS q ON q.id = qs.questionid&lt;br /&gt;
WHERE quiz.course = %%COURSEID%%&lt;br /&gt;
ORDER BY quiz.id ASC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Quiz activity research===&lt;br /&gt;
This report was made to extract student full activity in quizzes for an academic research about adapting instructional design teaching methods in online learning. The students do not use the Quiz module as a standard quiz but more as Study booklets or mini courses with embedded questions and hints to assist students evaluate their progress (Similar to what you expect to find in a SCORM activity)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
cm.course &amp;quot;course_id&amp;quot;, cm.id &amp;quot;moduel_id&amp;quot;, q.id &amp;quot;quiz_id&amp;quot;, q.name &amp;quot;quiz_name&amp;quot;,&lt;br /&gt;
 &lt;br /&gt;
CASE q.grademethod&lt;br /&gt;
      WHEN 1 THEN &amp;quot;GRADEHIGHEST&amp;quot;&lt;br /&gt;
      WHEN 2 THEN &amp;quot;GRADEAVERAGE&amp;quot;&lt;br /&gt;
      WHEN 3 THEN &amp;quot;ATTEMPTFIRST&amp;quot;&lt;br /&gt;
      WHEN 4 THEN &amp;quot;ATTEMPTLAST&amp;quot;&lt;br /&gt;
END &amp;quot;grade method&amp;quot;&lt;br /&gt;
   &lt;br /&gt;
, q.attempts &amp;quot;quiz_attempts_allowed&amp;quot;, cm.groupmode &amp;quot;group_mode&amp;quot;&lt;br /&gt;
, qa.id &amp;quot;attempt_id&amp;quot;, qa.state &amp;quot;attempt_state&amp;quot;, qa.sumgrades &amp;quot;attempt_grade&amp;quot;, qg.grade &amp;quot;user_final_grade&amp;quot;, q.grade &amp;quot;quiz_max_grade&amp;quot;&lt;br /&gt;
,(SELECT GROUP_CONCAT(g.name) FROM mdl_groups AS g&lt;br /&gt;
JOIN mdl_groups_members AS m ON g.id = m.groupid WHERE g.courseid = q.course AND m.userid = u.id) &amp;quot;user_groups&amp;quot;,&lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(qa.timestart), &#039;%d-%m-%Y %h:%k&#039;) &amp;quot;attempt_start&amp;quot;,&lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(qa.timefinish), &#039;%d-%m-%Y %h:%k&#039;) &amp;quot;attempt_finish&amp;quot;,&lt;br /&gt;
u.id &amp;quot;user_id&amp;quot;, u.firstname, u.lastname,&lt;br /&gt;
question.id &amp;quot;question_id&amp;quot;, question.name &amp;quot;question_name&amp;quot;,&lt;br /&gt;
qas.state &amp;quot;question_step_state&amp;quot;,qas.fraction &amp;quot;question_grade&amp;quot;, qh.hint, question.qtype &amp;quot;question_type&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM mdl_quiz as q&lt;br /&gt;
JOIN mdl_course_modules as cm ON cm.instance = q.id and cm.module = 14 &lt;br /&gt;
JOIN mdl_quiz_attempts qa ON q.id = qa.quiz&lt;br /&gt;
LEFT JOIN mdl_quiz_grades as qg ON qg.quiz = q.id and qg.userid = qa.userid&lt;br /&gt;
JOIN mdl_user as u ON u.id = qa.userid&lt;br /&gt;
JOIN mdl_question_usages as qu ON qu.id = qa.uniqueid&lt;br /&gt;
JOIN mdl_question_attempts as qatt ON qatt.questionusageid = qu.id&lt;br /&gt;
JOIN mdl_question as question ON question.id = qatt.questionid&lt;br /&gt;
JOIN mdl_question_attempt_steps as qas ON qas.questionattemptid = qatt.id&lt;br /&gt;
LEFT JOIN mdl_question_hints as qh ON qh.questionid = q.id&lt;br /&gt;
#WHERE q.id = &amp;quot;SOME QUIZ ID&amp;quot;&lt;br /&gt;
WHERE cm.course = &amp;quot;SOME COURSE ID&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Quiz Usage in Courses by Date===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College&lt;br /&gt;
&lt;br /&gt;
This report lists the courses containing quizzes with the course start date between the two values, and provides a summary of the types of questions in the quizzes in each course and whether question randomization and answer randomization functions were used.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Multiple Choice&amp;quot; questions include true/false and matching question types.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Short Answer&amp;quot; are questions that accept a single phrase.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Other&amp;quot; questions include fixed numerical, calculated, essay, and various drag and drop types.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Min Quiz Age&amp;quot; and &amp;quot;Max Quiz Age&amp;quot; provide data about the last modified date for the quizzes in the course, compared to the course start date. The values are expressed in units of days. A negative value indicates that a quiz was edited after the start of the course. A value greater than 90 days indicates that the quiz may have been used in an earlier term (cohort) without modification.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In Configurable Reports, the Date Filter is not applied until the &amp;quot;Apply&amp;quot; button is clicked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
&lt;br /&gt;
c.shortname AS &#039;Course&#039;&lt;br /&gt;
#, u.lastname AS &#039;Instructor&#039;&lt;br /&gt;
, COUNT(DISTINCT q.id) AS &#039;Quizzes&#039;&lt;br /&gt;
, COUNT(DISTINCT qu.id) AS &#039;Questions&#039;&lt;br /&gt;
, SUM(IF (qu.qtype = &#039;multichoice&#039;, 1, 0 )) + SUM(IF (qu.qtype = &#039;truefalse&#039;, 1, 0 )) + SUM(IF (qu.qtype = &#039;match&#039;, 1, 0 ))  AS &#039;multichoice&#039;&lt;br /&gt;
&lt;br /&gt;
, SUM(IF (qu.qtype = &#039;shortanswer&#039;, 1, 0 )) AS &#039;shortanswer&#039;&lt;br /&gt;
&lt;br /&gt;
, COUNT( qu.id) - SUM(IF (qu.qtype = &#039;multichoice&#039;, 1, 0 )) - SUM(IF (qu.qtype = &#039;truefalse&#039;, 1, 0 )) - SUM(IF (qu.qtype = &#039;match&#039;, 1, 0 )) - SUM(IF (qu.qtype = &#039;shortanswer&#039;, 1, 0 )) AS &#039;Other&#039;&lt;br /&gt;
&lt;br /&gt;
, (SUM(IF (qu.qtype = &#039;multichoice&#039;, 1, 0 )) + SUM(IF (qu.qtype = &#039;truefalse&#039;, 1, 0 )) + SUM(IF (qu.qtype = &#039;match&#039;, 1, 0 )))/COUNT( qu.id) AS &#039;Percent MC&#039;&lt;br /&gt;
&lt;br /&gt;
#, SUM(IF (qu.qtype = &#039;numerical&#039;, 1, 0 )) AS &#039;numerical&#039;&lt;br /&gt;
#, SUM(IF (qu.qtype LIKE &#039;calc%&#039;, 1, 0 )) AS &#039;calculated&#039;&lt;br /&gt;
#, SUM(IF (qu.qtype = &#039;random&#039;, 1, 0 )) AS &#039;random&#039;&lt;br /&gt;
#, SUM(IF (qu.qtype = &#039;shortanswer&#039;, 1, 0 )) AS &#039;shortanswer&#039;&lt;br /&gt;
#, SUM(IF (qu.qtype = &#039;essay&#039;, 1, 0 )) AS &#039;essay&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
, IF(q.shufflequestions &amp;gt; 0,&#039;Yes&#039;,&#039;No&#039;) AS &#039;Randomized Questions&#039;&lt;br /&gt;
, IF(q.shuffleanswers &amp;gt; 0,&#039;Yes&#039;,&#039;No&#039;) AS &#039;Randomized Answers&#039;&lt;br /&gt;
 &lt;br /&gt;
#, FROM_UNIXTIME(c.startdate) AS &#039;Course Start Date&#039;&lt;br /&gt;
#, FROM_UNIXTIME(MIN(q.timemodified)) AS &#039;Last Modified&#039;&lt;br /&gt;
&lt;br /&gt;
#, DATEDIFF(FROM_UNIXTIME(c.startdate),FROM_UNIXTIME(MIN(q.timemodified))) AS &#039;Quiz age&#039;&lt;br /&gt;
&lt;br /&gt;
, MIN(DATEDIFF(FROM_UNIXTIME(c.startdate),FROM_UNIXTIME(q.timemodified))) AS &#039;Min Quiz Age&#039; &lt;br /&gt;
, MAX(DATEDIFF(FROM_UNIXTIME(c.startdate),FROM_UNIXTIME(q.timemodified))) AS &#039;Max Quiz Age&#039; &lt;br /&gt;
&lt;br /&gt;
#, SUM(IF (DATEDIFF(FROM_UNIXTIME(c.startdate),FROM_UNIXTIME(q.timemodified)) &amp;lt; 90, 1,0)) AS &#039;new quizzes&#039;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_quiz AS q&lt;br /&gt;
JOIN prefix_course AS c on c.id = q.course&lt;br /&gt;
JOIN prefix_quiz_question_instances AS qqi ON qqi.quiz = q.id&lt;br /&gt;
LEFT JOIN prefix_question AS qu ON qu.id = qqi.question&lt;br /&gt;
&lt;br /&gt;
WHERE&lt;br /&gt;
1&lt;br /&gt;
%%FILTER_STARTTIME:c.startdate:&amp;gt;%% %%FILTER_ENDTIME:c.startdate:&amp;lt;%%&lt;br /&gt;
&lt;br /&gt;
GROUP BY c.id&lt;br /&gt;
&lt;br /&gt;
ORDER BY c.shortname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Student responses (answers) to quiz questions===&lt;br /&gt;
(Contributed by Juan F with help from Tim hunt and fellow Moodlers on the forums)&lt;br /&gt;
A report that targets a specific quiz for all of our Biology courses, a summary of all questions and how many students get them right/wrong.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
    concat( u.firstname, &amp;quot; &amp;quot;, u.lastname ) AS &amp;quot;Student Name&amp;quot;,&lt;br /&gt;
    u.id,&lt;br /&gt;
    quiza.userid,&lt;br /&gt;
    q.course,&lt;br /&gt;
    q.name,&lt;br /&gt;
    quiza.attempt,&lt;br /&gt;
    qa.slot,&lt;br /&gt;
    que.questiontext AS &#039;Question&#039;,&lt;br /&gt;
    qa.rightanswer AS &#039;Correct Answer&#039;,&lt;br /&gt;
    qa.responsesummary AS &#039;Student Answer&#039;&lt;br /&gt;
&lt;br /&gt;
FROM mdl_quiz_attempts quiza&lt;br /&gt;
JOIN mdl_quiz q ON q.id=quiza.quiz&lt;br /&gt;
JOIN mdl_question_usages qu ON qu.id = quiza.uniqueid&lt;br /&gt;
JOIN mdl_question_attempts qa ON qa.questionusageid = qu.id&lt;br /&gt;
JOIN mdl_question que ON que.id = qa.questionid&lt;br /&gt;
JOIN mdl_user u ON u.id = quiza.userid&lt;br /&gt;
&lt;br /&gt;
WHERE q.name = &amp;quot;BIO 208 Post Test Assessment&amp;quot;&lt;br /&gt;
AND q.course = &amp;quot;17926&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ORDER BY quiza.userid, quiza.attempt, qa.slot&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Questions which are tagged within a course/quiz===&lt;br /&gt;
Calculates subgrades for tags in the each of the quizzes in a course. &lt;br /&gt;
Contributed by Daniel Thies in https://moodle.org/mod/forum/discuss.php?d=324314#p1346542&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
    quiz.name AS quiz,&lt;br /&gt;
    t.rawname AS tag,&lt;br /&gt;
    CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/quiz/review.php?attempt=&#039;,&lt;br /&gt;
            MAX(quiza.id),&#039;&amp;quot;&amp;gt;&#039;,u.firstname,&#039; &#039;,u.lastname,&#039;&amp;lt;/a&amp;gt;&#039;) AS student,&lt;br /&gt;
    CAST(SUM(qas.fraction) as decimal(12,1)) AS correct,&lt;br /&gt;
    CAST(SUM(qa.maxmark) as decimal(12,1)) AS maximum,&lt;br /&gt;
    CAST(SUM(qas.fraction)/SUM(qa.maxmark)*100 as decimal(4,2)) AS score&lt;br /&gt;
FROM prefix_quiz_attempts quiza&lt;br /&gt;
JOIN prefix_user u ON quiza.userid = u.id&lt;br /&gt;
JOIN prefix_question_usages qu ON qu.id = quiza.uniqueid&lt;br /&gt;
JOIN prefix_question_attempts qa ON qa.questionusageid = qu.id&lt;br /&gt;
JOIN prefix_quiz quiz ON quiz.id = quiza.quiz&lt;br /&gt;
JOIN prefix_tag_instance ti ON qa.questionid = ti.itemid&lt;br /&gt;
JOIN prefix_tag t ON t.id = ti.tagid&lt;br /&gt;
JOIN (SELECT MAX(fraction) AS fraction, questionattemptid&lt;br /&gt;
        FROM prefix_question_attempt_steps&lt;br /&gt;
        GROUP BY questionattemptid) qas ON qas.questionattemptid = qa.id &lt;br /&gt;
WHERE quiz.course = %%COURSEID%%&lt;br /&gt;
GROUP BY quiza.userid,&lt;br /&gt;
    quiza.quiz,&lt;br /&gt;
    quiz.name,&lt;br /&gt;
    u.firstname,&lt;br /&gt;
    u.lastname,&lt;br /&gt;
    ti.tagid,&lt;br /&gt;
    t.rawname&lt;br /&gt;
ORDER BY quiza.quiz, t.rawname, u.lastname, u.firstname, score&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SCORM Activity Reports==&lt;br /&gt;
&lt;br /&gt;
===Lists All completed SCORM activites by Course name===&lt;br /&gt;
This report will list all completed attempts for all SCORM activities. It is ordered first by Course name, then student&#039;s last name, then student&#039;s first name, then attempt number. Please note: the FROM_UNIXTIME command is for MySQL.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.firstname First,u.lastname Last,c.fullname Course, st.attempt Attempt,st.value Status,FROM_UNIXTIME(st.timemodified,&amp;quot;%m-%d-%Y&amp;quot;) Date &lt;br /&gt;
FROM prefix_scorm_scoes_track AS st &lt;br /&gt;
JOIN prefix_user AS u ON st.userid=u.id&lt;br /&gt;
JOIN prefix_scorm AS sc ON sc.id=st.scormid&lt;br /&gt;
JOIN prefix_course AS c ON c.id=sc.course&lt;br /&gt;
WHERE st.value=&#039;completed&#039; &lt;br /&gt;
ORDER BY c.fullname, u.lastname,u.firstname, st.attempt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lists SCORM status for all enrolled users by Course name===&lt;br /&gt;
This report will list the SCORM status for all users enrolled in the course. It is ordered first by Course name, then student&#039;s last name, then student&#039;s first name, then attempt number. This can be limited to individual courses by adding to the where clause the course id to report on.  &lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
u.firstname AS First,&lt;br /&gt;
u.lastname AS Last, &lt;br /&gt;
u.idnumber AS Employee_ID,  &lt;br /&gt;
u.city AS City,&lt;br /&gt;
uid.data AS State,&lt;br /&gt;
u.country AS Country,&lt;br /&gt;
g.name AS Group_name,&lt;br /&gt;
c.fullname AS Course, &lt;br /&gt;
st.attempt AS Attempt,&lt;br /&gt;
st.value AS Status,&lt;br /&gt;
FROM_UNIXTIME(st.timemodified,&amp;quot;%m-%d-%Y&amp;quot;) AS Date &lt;br /&gt;
&lt;br /&gt;
FROM prefix_scorm_scoes_track AS st &lt;br /&gt;
JOIN prefix_user AS u ON st.userid=u.id&lt;br /&gt;
JOIN prefix_user_info_data AS uid ON uid.userid = u.id &lt;br /&gt;
JOIN prefix_scorm AS sc ON sc.id=st.scormid&lt;br /&gt;
JOIN prefix_course AS c ON c.id=sc.course&lt;br /&gt;
JOIN prefix_groups AS g ON g.courseid = c.id&lt;br /&gt;
JOIN prefix_groups_members AS m ON g.id = m.groupid&lt;br /&gt;
&lt;br /&gt;
WHERE st.element=&#039;cmi.core.lesson_status&#039; AND m.userid=u.id&lt;br /&gt;
&lt;br /&gt;
UNION&lt;br /&gt;
&lt;br /&gt;
SELECT&lt;br /&gt;
user2.firstname AS First,&lt;br /&gt;
user2.lastname AS Last,&lt;br /&gt;
user2. idnumber AS Employee_ID,&lt;br /&gt;
user2.city AS City,&lt;br /&gt;
uid.data AS State,&lt;br /&gt;
user2.country AS Country,&lt;br /&gt;
g.name AS Group_name,&lt;br /&gt;
c.fullname AS Course,&lt;br /&gt;
&amp;quot;-&amp;quot; AS Attempt,&lt;br /&gt;
&amp;quot;not_started&amp;quot; AS Status,&lt;br /&gt;
&amp;quot;-&amp;quot; AS Date&lt;br /&gt;
&lt;br /&gt;
FROM prefix_user_enrolments AS ue&lt;br /&gt;
JOIN prefix_enrol AS e ON e.id = ue.enrolid&lt;br /&gt;
JOIN prefix_course AS c ON c.id = e.courseid&lt;br /&gt;
JOIN prefix_user AS user2 ON user2 .id = ue.userid&lt;br /&gt;
JOIN prefix_user_info_data AS uid ON uid.userid = user2.id &lt;br /&gt;
JOIN prefix_groups AS g ON g.courseid = c.id&lt;br /&gt;
JOIN prefix_groups_members AS m ON g.id = m.groupid&lt;br /&gt;
JOIN prefix_scorm AS sc ON sc.course=c.id&lt;br /&gt;
Left Join prefix_scorm_scoes_track AS st on st.scormid=sc.id AND st.userid=user2.id&lt;br /&gt;
&lt;br /&gt;
WHERE  st.timemodified IS NULL AND m.userid=user2.id&lt;br /&gt;
&lt;br /&gt;
ORDER BY  Course, Last, First, Attempt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Badges==&lt;br /&gt;
&lt;br /&gt;
=== All badges issued, by User ===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
This report will show you all the badges on a site that have been issued, both site and all courses, by the username of each user issued a badge. Includes the type of criteria passed (activity, course completion, manual), date issued, date expires, and a direct link to that issued badge page so you can see all the other details for that badge.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.username, b.name AS badgename, &lt;br /&gt;
CASE&lt;br /&gt;
WHEN b.courseid IS NOT NULL THEN&lt;br /&gt;
(SELECT c.shortname&lt;br /&gt;
    FROM prefix_course AS c&lt;br /&gt;
    WHERE c.id = b.courseid)&lt;br /&gt;
WHEN b.courseid IS NULL THEN &amp;quot;*&amp;quot;&lt;br /&gt;
END AS Context,&lt;br /&gt;
CASE &lt;br /&gt;
  WHEN t.criteriatype = 1 AND t.method = 1 THEN &amp;quot;Activity Completion (All)&amp;quot;&lt;br /&gt;
  WHEN t.criteriatype = 1 AND t.method = 2 THEN &amp;quot;Activity Completion (Any)&amp;quot;&lt;br /&gt;
  WHEN t.criteriatype = 2 AND t.method = 2 THEN &amp;quot;Manual Award&amp;quot;&lt;br /&gt;
  WHEN t.criteriatype = 4 AND t.method = 1 THEN &amp;quot;Course Completion (All)&amp;quot;&lt;br /&gt;
  WHEN t.criteriatype = 4 AND t.method = 2 THEN &amp;quot;Course Completion (Any)&amp;quot;&lt;br /&gt;
  ELSE CONCAT (&#039;Other: &#039;, t.criteriatype)&lt;br /&gt;
END AS Criteriatype,&lt;br /&gt;
DATE_FORMAT( FROM_UNIXTIME( d.dateissued ) , &#039;%Y-%m-%d&#039; ) AS dateissued,&lt;br /&gt;
DATE_FORMAT( FROM_UNIXTIME( d.dateexpire ), &#039;%Y-%m-%d&#039; ) AS dateexpires,&lt;br /&gt;
CONCAT (&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/badges/badge.php?hash=&#039;,d.uniquehash,&#039;&amp;quot;&amp;gt;link&amp;lt;/a&amp;gt;&#039;) AS Details&lt;br /&gt;
FROM prefix_badge_issued AS d &lt;br /&gt;
JOIN prefix_badge AS b ON d.badgeid = b.id&lt;br /&gt;
JOIN prefix_user AS u ON d.userid = u.id&lt;br /&gt;
JOIN prefix_badge_criteria AS t on b.id = t.badgeid &lt;br /&gt;
WHERE t.criteriatype &amp;lt;&amp;gt; 0&lt;br /&gt;
ORDER BY u.username&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: the FROM_UNIXTIME command is for MySQL.&lt;br /&gt;
&lt;br /&gt;
=== All badges available in the system, with Earned count ===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
Report of all badges in the system, with badge name and description, context, course shortname if a course badge, whether it is active and available, and a count of how many users have been issued that badge.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT b.id, b.name, b.description,&lt;br /&gt;
CASE&lt;br /&gt;
WHEN b.type = 1 THEN &amp;quot;System&amp;quot;&lt;br /&gt;
WHEN b.type = 2 THEN &amp;quot;Course&amp;quot;&lt;br /&gt;
END AS Context, &lt;br /&gt;
CASE&lt;br /&gt;
WHEN b.courseid IS NOT NULL THEN &lt;br /&gt;
(SELECT c.shortname &lt;br /&gt;
    FROM prefix_course AS c &lt;br /&gt;
    WHERE c.id = b.courseid)&lt;br /&gt;
WHEN b.courseid IS NULL THEN &amp;quot;*&amp;quot;&lt;br /&gt;
END AS Course, &lt;br /&gt;
CASE&lt;br /&gt;
WHEN b.status = 0 OR b.status = 2 THEN &amp;quot;No&amp;quot;&lt;br /&gt;
WHEN b.status = 1 OR b.status = 3 THEN &amp;quot;Yes&amp;quot;&lt;br /&gt;
WHEN b.status = 4 THEN &amp;quot;x&amp;quot;&lt;br /&gt;
END AS Available,&lt;br /&gt;
CASE&lt;br /&gt;
WHEN b.status = 0 OR b.status = 1 THEN &amp;quot;0&amp;quot;&lt;br /&gt;
WHEN b.status = 2 OR b.status = 3 OR b.status = 4 THEN &lt;br /&gt;
 (SELECT COUNT(*) &lt;br /&gt;
   FROM prefix_badge_issued AS d&lt;br /&gt;
   WHERE d.badgeid = b.id&lt;br /&gt;
 )&lt;br /&gt;
END AS Earned&lt;br /&gt;
FROM prefix_badge AS b&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Badges Leaderboard ===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
A simple list of usernames and how many badges they have earned overall.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.username, (SELECT COUNT(*) FROM prefix_badge_issued AS d WHERE d.userid = u.id) AS earned&lt;br /&gt;
FROM prefix_user AS u&lt;br /&gt;
ORDER BY earned DESC, u.username ASC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manage badges (System &amp;amp; Course) ===&lt;br /&gt;
&lt;br /&gt;
List system wide badges, course and system level badges + a link to relevant &amp;quot;manage badges&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT b.id, b.name, b.description &lt;br /&gt;
,CASE &lt;br /&gt;
  WHEN b.type = 1 THEN &#039;System&#039;&lt;br /&gt;
  WHEN b.type = 2 THEN &#039;Course&#039;&lt;br /&gt;
END AS Level&lt;br /&gt;
,CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/badges/index.php?type=&#039;, b.type, &#039;&amp;amp;id=&#039;,&lt;br /&gt;
			  c.id, &#039;&amp;quot;&amp;gt;Manage badges in: &#039;, c.fullname, &#039;&amp;lt;/a&amp;gt;&#039;) AS Manage &lt;br /&gt;
FROM prefix_badge AS b&lt;br /&gt;
JOIN prefix_course AS c ON c.id = b.courseid&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Administrator Reports==&lt;br /&gt;
&lt;br /&gt;
===Config changes in Export friendly form===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
The Administrative report Config changes is very useful but it would be nice to have it in a format that could be easily exported in one listing. Here is code to do that.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
DATE_FORMAT( FROM_UNIXTIME( g.timemodified ) , &#039;%Y-%m-%d&#039; ) AS date, &lt;br /&gt;
u.username AS user, &lt;br /&gt;
g.name AS setting, &lt;br /&gt;
CASE &lt;br /&gt;
 WHEN g.plugin IS NULL THEN &amp;quot;core&amp;quot;&lt;br /&gt;
 ELSE g.plugin&lt;br /&gt;
END AS plugin, &lt;br /&gt;
g.value AS new_value, &lt;br /&gt;
g.oldvalue AS original_value&lt;br /&gt;
FROM prefix_config_log  AS g&lt;br /&gt;
JOIN prefix_user AS u ON g.userid = u.id&lt;br /&gt;
ORDER BY date DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Cohorts by user===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
How to get a list of all users and which cohorts they belong to.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.firstname, u.lastname, h.idnumber, h.name&lt;br /&gt;
FROM prefix_cohort AS h&lt;br /&gt;
JOIN prefix_cohort_members AS hm ON h.id = hm.cohortid&lt;br /&gt;
JOIN prefix_user AS u ON hm.userid = u.id&lt;br /&gt;
ORDER BY u.firstname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Cohorts with Courses===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
List of all cohorts with name, id, visibility, and which courses they are enrolled in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
# h.id,&lt;br /&gt;
# e.customint1,&lt;br /&gt;
h.name AS Cohort,&lt;br /&gt;
h.idnumber AS Cohortid,&lt;br /&gt;
CASE &lt;br /&gt;
 WHEN h.visible = 1 THEN &#039;Yes&#039;&lt;br /&gt;
 ELSE &#039;-&#039;&lt;br /&gt;
END AS Cohortvisible,&lt;br /&gt;
CONCAT(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php&#039;, CHAR(63),&#039;id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
FROM prefix_cohort h&lt;br /&gt;
JOIN prefix_enrol e ON h.id = e.customint1&lt;br /&gt;
JOIN prefix_course c ON c.id = e.courseid %%FILTER_COURSES:e.courseid%% &lt;br /&gt;
WHERE e.enrol = &#039;cohort&#039; AND e.roleid = 5&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Courses created And Active courses by Year===&lt;br /&gt;
Active courses is counting course that have at least one Hit, And &amp;quot;Active_MoreThan100Hits&amp;quot; counts courses that have at least 100 Hits&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
&lt;br /&gt;
YEAR( FROM_UNIXTIME( `timecreated` ) ) AS YEAR, COUNT( * ) AS Counter&lt;br /&gt;
&lt;br /&gt;
, (SELECT COUNT( DISTINCT course ) &lt;br /&gt;
FROM prefix_log AS l&lt;br /&gt;
WHERE YEAR( FROM_UNIXTIME( l.`time` ) ) = YEAR( FROM_UNIXTIME( `timecreated` ) )&lt;br /&gt;
) AS &amp;quot;Active&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) FROM ( &lt;br /&gt;
SELECT COUNT( * ),time &lt;br /&gt;
FROM prefix_log AS l &lt;br /&gt;
GROUP BY course &lt;br /&gt;
HAVING COUNT(*) &amp;gt; 100) AS courses_log&lt;br /&gt;
WHERE YEAR( FROM_UNIXTIME( courses_log.`time` ) ) = YEAR( FROM_UNIXTIME( `timecreated` ) )&lt;br /&gt;
) AS &amp;quot;Active_MoreThan100Hits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM `prefix_course` &lt;br /&gt;
GROUP BY YEAR( FROM_UNIXTIME( `timecreated` ) ) &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Users created And Active users by Year===&lt;br /&gt;
Active users is counting users that have at least one Hit, And &amp;quot;Active_MoreThan500Hits&amp;quot; counts users that have at least 500 Hits&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
&lt;br /&gt;
YEAR( FROM_UNIXTIME( `firstaccess` ) ) AS YEAR, COUNT( * ) AS Counter&lt;br /&gt;
&lt;br /&gt;
, (SELECT COUNT( DISTINCT userid ) &lt;br /&gt;
FROM prefix_log AS l&lt;br /&gt;
WHERE YEAR( FROM_UNIXTIME( l.`time` ) ) = YEAR( FROM_UNIXTIME( `firstaccess` ) )&lt;br /&gt;
) AS &amp;quot;Active&amp;quot;&lt;br /&gt;
&lt;br /&gt;
,(SELECT COUNT(*) FROM ( &lt;br /&gt;
SELECT COUNT( * ),time &lt;br /&gt;
FROM prefix_log AS l &lt;br /&gt;
GROUP BY userid &lt;br /&gt;
HAVING COUNT(*) &amp;gt; 500) AS users_log&lt;br /&gt;
WHERE YEAR( FROM_UNIXTIME( users_log.`time` ) ) = YEAR( FROM_UNIXTIME( `firstaccess` ) )&lt;br /&gt;
) AS &amp;quot;Active_MoreThan500Hits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM `prefix_user` &lt;br /&gt;
GROUP BY YEAR( FROM_UNIXTIME( `timecreated` ) ) &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Course Aggregation Report===&lt;br /&gt;
Contributed by Elizabeth Dalton, Granite State College&lt;br /&gt;
&lt;br /&gt;
If you are considering upgrading from Moodle 2.6 to 2.8 or later, your grades may be changed. This report can help quantify and identify the courses at risk of changes.&lt;br /&gt;
&lt;br /&gt;
In particular, be on the lookout for any courses with the following combinations of parameters, which are known to cause changes in calculations:&lt;br /&gt;
&lt;br /&gt;
# mean of grades set with aggregate with subcategory.&lt;br /&gt;
# Simple weighted mean of grades with aggregate with sub category and drop the lowest&lt;br /&gt;
# Sum of grades drop the lowest&lt;br /&gt;
&lt;br /&gt;
Also review:&lt;br /&gt;
https://tracker.moodle.org/browse/MDL-48618&lt;br /&gt;
https://tracker.moodle.org/browse/MDL-48634&lt;br /&gt;
https://tracker.moodle.org/browse/MDL-49257&lt;br /&gt;
https://tracker.moodle.org/browse/MDL-50089&lt;br /&gt;
https://tracker.moodle.org/browse/MDL-50062&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;br /&gt;
COUNT(c.shortname) AS &#039;Count of Courses&#039;&lt;br /&gt;
&lt;br /&gt;
# If you want to display all the courses for each aggregation type, uncomment the next line and change GROUP BY settings&lt;br /&gt;
#, c.shortname AS &#039;course name&#039;&lt;br /&gt;
&lt;br /&gt;
# If you need to display grade categories for each aggregation type, uncomment the next line and change GROUP BY settings&lt;br /&gt;
#, gc.fullname AS &#039;grade category name&#039;&lt;br /&gt;
&lt;br /&gt;
, gc.aggregation AS &#039;aggregation method&#039;&lt;br /&gt;
&lt;br /&gt;
#These aggregation text strings appear to be hard-coded. I couldn&#039;t find a table for them. If you have aggregation types I haven&#039;t included here, they&#039;ll be blank in your report results.&lt;br /&gt;
, CASE gc.aggregation&lt;br /&gt;
  WHEN 0 THEN &#039;Mean of Grades&#039;&lt;br /&gt;
  WHEN 2 THEN &#039;Median of Grades&#039;&lt;br /&gt;
  WHEN 6 THEN &#039;Highest Grade&#039;&lt;br /&gt;
  WHEN 8 THEN &#039;Mode of Grades&#039;&lt;br /&gt;
  WHEN 10 THEN &#039;Weighted Mean of Grades&#039;&lt;br /&gt;
  WHEN 11 THEN &#039;Simple Weighted Mean of Grades&#039;&lt;br /&gt;
  WHEN 12 THEN &#039;Mean of Grades (with extra credits)&#039;&lt;br /&gt;
  WHEN 13 THEN &#039;Sum of Grades&#039;&lt;br /&gt;
END AS &#039;aggregation name&#039;&lt;br /&gt;
&lt;br /&gt;
# Note that gc.aggregatesubcats column is eliminated in 2.8 and later per MDL-47503, so comment that line on updated systems or you&#039;ll get an error&lt;br /&gt;
, gc.keephigh AS &#039;keep high&#039;&lt;br /&gt;
, gc.droplow AS &#039;dr0p low&#039;&lt;br /&gt;
, gc.aggregateonlygraded AS &#039;Aggregate only graded&#039;&lt;br /&gt;
, gc.aggregateoutcomes AS &#039;aggregate outcomes&#039;&lt;br /&gt;
, gc.aggregatesubcats AS &#039;aggregate subcategories&#039;&lt;br /&gt;
&lt;br /&gt;
# If you are displaying data about individual courses, you may want to know how old they are&lt;br /&gt;
#, FROM_UNIXTIME(c.startdate) AS &#039;course start date&#039;&lt;br /&gt;
&lt;br /&gt;
# If you are trying to use this report to check to see if final grades have changed after an upgrade, you might want these data items, but calculations can still change later when the courses are actually viewed. Also, you&#039;ll need to uncomment the necessary JOINs below&lt;br /&gt;
#, gi.itemname AS &#039;grade item&#039;&lt;br /&gt;
#, gg.finalgrade AS &#039;final grade&#039;&lt;br /&gt;
&lt;br /&gt;
FROM&lt;br /&gt;
&lt;br /&gt;
prefix_course AS c&lt;br /&gt;
JOIN prefix_grade_categories AS gc ON gc.courseid = c.id&lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category&lt;br /&gt;
&lt;br /&gt;
#LEFT JOIN prefix_grade_items AS gi ON gi.courseid = c.id #AND gi.categoryid=gc.id&lt;br /&gt;
#LEFT JOIN prefix_grade_grades AS gg ON gg.itemid = gi.id AND gg.userid = u.id&lt;br /&gt;
&lt;br /&gt;
WHERE&lt;br /&gt;
1&lt;br /&gt;
#AND gc.aggregation = 13 #only the dreaded Sum of Grades aggregations&lt;br /&gt;
#AND gc.depth = 1 # if for some reason you only want course aggregations, not subcategories&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GROUP BY gc.aggregation, gc.keephigh, gc.droplow, gc.aggregateonlygraded, gc.aggregateoutcomes, gc.aggregatesubcats&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running Cron jobs (task_scheduled) ===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT classname&lt;br /&gt;
  ,DATE_FORMAT(FROM_UNIXTIME(lastruntime), &#039;%H:%i [%d]&#039;) AS &#039;last&#039;&lt;br /&gt;
  ,DATE_FORMAT(now(), &#039;%H:%i&#039;) AS &#039;now&#039;&lt;br /&gt;
  ,DATE_FORMAT(FROM_UNIXTIME(nextruntime), &#039;%H:%i [%d]&#039;) AS &#039;next&#039;&lt;br /&gt;
  ,DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP()-nextruntime), &#039;%i&#039;) AS &#039;next in min&#039;&lt;br /&gt;
FROM mdl_task_scheduled&lt;br /&gt;
WHERE now() &amp;gt; FROM_UNIXTIME(nextruntime)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== All Meta courses with Parent and Child course relationships ===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
This shows the list of courses with Meta course link enrollments in them (&#039;Parent course&#039;), and the courses which are connected to them to provide enrollments (&#039;Child courses&#039;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
c.fullname AS &#039;Parent course name&#039;,&lt;br /&gt;
c.shortname AS &#039;Parent course shortname&#039;,&lt;br /&gt;
en.courseid AS &#039;Parent course id&#039;,&lt;br /&gt;
(SELECT fullname FROM prefix_course WHERE prefix_course.id = en.customint1) As &#039;Child course name&#039;,&lt;br /&gt;
(SELECT shortname FROM prefix_course WHERE prefix_course.id = en.customint1) As &#039;Child course shortname&#039;,&lt;br /&gt;
en.customint1 AS &#039;Child course id&#039;&lt;br /&gt;
FROM prefix_enrol en&lt;br /&gt;
JOIN prefix_course c ON c.id = en.courseid&lt;br /&gt;
WHERE en.enrol = &#039;meta&#039;&lt;br /&gt;
ORDER BY c.fullname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== All Private Files by User ===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
Lists all files by all users in the Private Files repository, with the file path location and name in the moodledata/filedir directory structure, and time created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
u.username, &lt;br /&gt;
f.filename, &lt;br /&gt;
CONCAT(&#039;/&#039;, LEFT(f.contenthash,2), &#039;/&#039;, MID(f.contenthash,3,2), &#039;/&#039;, f.contenthash) AS &amp;quot;Filedir_Location&amp;quot;,&lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(f.timecreated),&#039;%Y-%m-%d %H:%i&#039;) AS &amp;quot;Created&amp;quot;&lt;br /&gt;
FROM prefix_files f &lt;br /&gt;
JOIN prefix_user u ON u.id = f.userid&lt;br /&gt;
WHERE f.component = &#039;user&#039; &lt;br /&gt;
AND f.filearea = &#039;private&#039; &lt;br /&gt;
AND f.filesize &amp;gt; 0 &lt;br /&gt;
ORDER BY u.username, f.filename&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Learning Analytics Reports ==&lt;br /&gt;
(Moodle v. 3.4 and later)&lt;br /&gt;
&lt;br /&gt;
=== Learning Analytics Model Summary ===&lt;br /&gt;
This report provides a list of the learning analytics models on your site, whether enabled or not, and several details about them.&lt;br /&gt;
&lt;br /&gt;
(Note: this report was created on a system using PostgreSQL. Some changes may be needed for other forms of SQL.)&lt;br /&gt;
Contributed by Elizabeth Dalton, Moodle HQ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
am.id AS &amp;quot;model id&amp;quot;,	 &lt;br /&gt;
split_part(am.target,&#039;\&#039;,5) AS &amp;quot;target&amp;quot;,&lt;br /&gt;
CASE WHEN am.enabled=1 THEN &#039;YES&#039; ELSE &#039;NO&#039; END AS &amp;quot;enabled&amp;quot;,	 &lt;br /&gt;
CASE WHEN am.trained=1 THEN &#039;YES&#039; ELSE &#039;NO&#039; END AS &amp;quot;trained&amp;quot;,&lt;br /&gt;
am.name,	 &lt;br /&gt;
/* indicators,*/&lt;br /&gt;
char_length(am.indicators) - char_length(REPLACE(am.indicators,&#039;,&#039;,&#039;&#039;))+1 AS &amp;quot;indicator count&amp;quot;,&lt;br /&gt;
split_part(am.timesplitting,&#039;\&#039;,5) AS &amp;quot;interval&amp;quot;,&lt;br /&gt;
/*&lt;br /&gt;
to_timestamp(am.version) AS &amp;quot;version&amp;quot;,	 &lt;br /&gt;
to_timestamp(am.timecreated) AS &amp;quot;time created&amp;quot;,	 &lt;br /&gt;
to_timestamp(am.timemodified) AS &amp;quot;time modified&amp;quot;,	&lt;br /&gt;
*/&lt;br /&gt;
COUNT(DISTINCT ap.contextid) AS &amp;quot;contexts&amp;quot;,&lt;br /&gt;
COUNT(ap.sampleid) AS &amp;quot;samples&amp;quot;,&lt;br /&gt;
/* AVG(ap.prediction) AS &amp;quot;avg prediction&amp;quot;, */&lt;br /&gt;
ROUND(ap.prediction,1) AS &amp;quot;prediction&amp;quot;,		   &lt;br /&gt;
ROUND(AVG(aml.score),3) AS &amp;quot;model accuracy (avg)&amp;quot;,&lt;br /&gt;
apa.actionname AS &amp;quot;action&amp;quot;,&lt;br /&gt;
COUNT(apa.id) AS &amp;quot;number actions taken&amp;quot;&lt;br /&gt;
		   &lt;br /&gt;
FROM prefix_analytics_models AS am&lt;br /&gt;
JOIN prefix_analytics_predictions AS ap ON am.id = ap.modelid&lt;br /&gt;
LEFT JOIN prefix_analytics_models_log AS aml ON aml.modelid = am.id&lt;br /&gt;
LEFT JOIN prefix_analytics_prediction_actions AS apa ON apa.predictionid = ap.id&lt;br /&gt;
GROUP BY am.id, ap.prediction, apa.actionname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Analytics Indicator Calculations ===&lt;br /&gt;
Pulls calculations from the &amp;quot;analytics_indicator_calc&amp;quot; table consisting of all calculations made for each indicator for each sample within each context for every model. In most cases you will want to limit this per context or sample, or at least group by context and sample.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
id,	 &lt;br /&gt;
to_timestamp(starttime) AS &amp;quot;start time&amp;quot;,	 &lt;br /&gt;
to_timestamp(endtime) AS &amp;quot;end time&amp;quot;,	 &lt;br /&gt;
contextid,	 &lt;br /&gt;
sampleorigin,	 &lt;br /&gt;
sampleid,	 &lt;br /&gt;
/*indicator, */&lt;br /&gt;
split_part(indicator,&#039;\&#039;,2) AS &amp;quot;module&amp;quot;,&lt;br /&gt;
split_part(indicator,&#039;\&#039;,5) AS &amp;quot;indicator type&amp;quot;,&lt;br /&gt;
value,	 &lt;br /&gt;
to_timestamp(timecreated) AS &amp;quot;time created&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_analytics_indicator_calc&lt;br /&gt;
WHERE id = 1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Analytics Models ===&lt;br /&gt;
Pulls data from the &amp;quot;analytics_models&amp;quot; table consisting of one row per model. See the &amp;quot;Learning Analytics Model Summary&amp;quot; report, above, for an expanded report that JOINs model data from different tables to provide a more comprehensive view.&lt;br /&gt;
Contributed by Elizabeth Dalton, Moodle HQ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
id,	 &lt;br /&gt;
enabled,	 &lt;br /&gt;
trained, &lt;br /&gt;
name,	 &lt;br /&gt;
split_part(target,&#039;\&#039;,5) AS &amp;quot;target&amp;quot;,&lt;br /&gt;
/* indicators,*/&lt;br /&gt;
char_length(indicators) - char_length(REPLACE(indicators,&#039;,&#039;,&#039;&#039;))+1 AS &amp;quot;indicator count&amp;quot;,&lt;br /&gt;
split_part(timesplitting,&#039;\&#039;,5) AS &amp;quot;interval&amp;quot;,&lt;br /&gt;
predictionsprocessor, &lt;br /&gt;
to_timestamp(version) AS &amp;quot;version&amp;quot;,	 &lt;br /&gt;
to_timestamp(timecreated) AS &amp;quot;time created&amp;quot;,	 &lt;br /&gt;
to_timestamp(timemodified) AS &amp;quot;time modified&amp;quot;,	 &lt;br /&gt;
usermodified&lt;br /&gt;
&lt;br /&gt;
FROM prefix_analytics_models&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Analytics Models Log ===&lt;br /&gt;
Pulls data from the &amp;quot;analytics_models_log&amp;quot; table consisting of evaluation calculations per model. If model evaluations have not been manually executed on the system from the command line, there will be no contents in this table.&lt;br /&gt;
Contributed by Elizabeth Dalton, Moodle HQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
id,	 &lt;br /&gt;
modelid,	 &lt;br /&gt;
to_timestamp(version) AS &amp;quot;version&amp;quot;,	 &lt;br /&gt;
evaluationmode,	 &lt;br /&gt;
split_part(target,&#039;\&#039;,5) AS &amp;quot;target&amp;quot;,	 &lt;br /&gt;
/* indicators,*/&lt;br /&gt;
char_length(indicators) - char_length(REPLACE(indicators,&#039;,&#039;,&#039;&#039;))+1 AS &amp;quot;indicator count&amp;quot;,&lt;br /&gt;
split_part(timesplitting,&#039;\&#039;,5) AS &amp;quot;interval&amp;quot;,	 &lt;br /&gt;
score,	 &lt;br /&gt;
info,	 &lt;br /&gt;
dir,	 &lt;br /&gt;
to_timestamp(timecreated) AS &amp;quot;time created&amp;quot;,	 &lt;br /&gt;
usermodified&lt;br /&gt;
&lt;br /&gt;
FROM prefix_analytics_models_log&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Analytics Predictions ===&lt;br /&gt;
Pulls data from the &amp;quot;analytics_predictions&amp;quot; table consisting of one row per prediction per model. Counts the number of indicators calculated for each prediction, but does not list them. If a model has not yet been trained, the system cannot make predictions and this table will not include rows for that model ID. See the &amp;quot;Learning Analytics Model Summary&amp;quot; report, above, for an expanded report that JOINs model data from different tables to provide a more comprehensive view.&lt;br /&gt;
Contributed by Elizabeth Dalton, Moodle HQ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
id,	 &lt;br /&gt;
modelid,	 &lt;br /&gt;
contextid,	 &lt;br /&gt;
sampleid,	 &lt;br /&gt;
rangeindex,	 &lt;br /&gt;
prediction,	 &lt;br /&gt;
predictionscore,	 &lt;br /&gt;
char_length(calculations) - char_length(REPLACE(calculations,&#039;,&#039;,&#039;&#039;))+1 AS &amp;quot;indicators calculated&amp;quot;,&lt;br /&gt;
to_timestamp(timecreated) AS &amp;quot;time created&amp;quot;,	 &lt;br /&gt;
to_timestamp(timestart) AS &amp;quot;time start&amp;quot;,	 &lt;br /&gt;
to_timestamp(timeend) AS &amp;quot;time end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
from prefix_analytics_predictions&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Analytics Prediction Actions ===&lt;br /&gt;
Pulls data from the &amp;quot;analytics_prediction_actions&amp;quot; table consisting of one row per action taken per prediction (e.g. a teacher viewing the outline report for a student at risk). If the model has not yet made predictions, there can be no prediction actions. See the &amp;quot;Learning Analytics Model Summary&amp;quot; report, above, for an expanded report that JOINs model data from different tables to provide a more comprehensive view.&lt;br /&gt;
Contributed by Elizabeth Dalton, Moodle HQ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
id,	 &lt;br /&gt;
predictionid,	 &lt;br /&gt;
userid,	 &lt;br /&gt;
actionname,	 &lt;br /&gt;
to_timestamp(timecreated) AS &amp;quot;time created&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_analytics_prediction_actions&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Analytics Predictions with All Indicators ===&lt;br /&gt;
Pulls data from the &amp;quot;analytics_predictions&amp;quot; table consisting of one row per prediction per model. Lists the indicators calculated for each prediction. If a model has not yet been trained, the system cannot make predictions and this table will not include rows for that model ID.&lt;br /&gt;
Contributed by Elizabeth Dalton, Moodle HQ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
id AS &amp;quot;Prediction ID&amp;quot;,	 &lt;br /&gt;
modelid AS &amp;quot;Model ID&amp;quot;,	 &lt;br /&gt;
contextid AS &amp;quot;Context ID&amp;quot;,	 &lt;br /&gt;
sampleid AS &amp;quot;Sample ID&amp;quot;,	 &lt;br /&gt;
rangeindex AS &amp;quot;Analysis Interval&amp;quot;,	 &lt;br /&gt;
prediction AS &amp;quot;Prediction value&amp;quot;,	 &lt;br /&gt;
predictionscore,	 &lt;br /&gt;
calculations,&lt;br /&gt;
char_length(calculations) - char_length(REPLACE(calculations,&#039;,&#039;,&#039;&#039;))+1 AS &amp;quot;indicators calculated&amp;quot;,&lt;br /&gt;
to_timestamp(timecreated) AS &amp;quot;time created&amp;quot;,	 &lt;br /&gt;
to_timestamp(timestart) AS &amp;quot;time start&amp;quot;,	 &lt;br /&gt;
to_timestamp(timeend) AS &amp;quot;time end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
from prefix_analytics_predictions&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Analytics Predict Samples ===&lt;br /&gt;
Pulls data from the &amp;quot;analytics_predict_samples&amp;quot; table consisting of one row per analysis interval per model, with a count of the samples used for each prediction. Sample details are not included here, but the report can be modified to list samples by IDs if needed by parsing the contents of the sampleids field. For example, this counts the number of student enrolments for which the system has generated predictions for a given model and analysis interval.&lt;br /&gt;
Contributed by Elizabeth Dalton, Moodle HQ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
id,	 &lt;br /&gt;
modelid,	 &lt;br /&gt;
analysableid,	 &lt;br /&gt;
split_part(timesplitting,&#039;\&#039;,5) AS &amp;quot;interval&amp;quot;,	 &lt;br /&gt;
rangeindex,	 &lt;br /&gt;
/* sampleids, */	 &lt;br /&gt;
char_length(sampleids) - char_length(REPLACE(sampleids,&#039;,&#039;,&#039;&#039;))+1 AS &amp;quot;samples used&amp;quot;,&lt;br /&gt;
to_timestamp(timecreated) AS &amp;quot;time created&amp;quot;,	 &lt;br /&gt;
to_timestamp(timemodified) AS &amp;quot;time modified&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_analytics_predict_samples&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Analytics Train Samples ===&lt;br /&gt;
Pulls data from the &amp;quot;analytics_train_samples&amp;quot; table consisting of one row per analysis interval per model, with a count of the samples used for each training calculation. &lt;br /&gt;
Contributed by Elizabeth Dalton, Moodle HQ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
id,	 &lt;br /&gt;
modelid,	 &lt;br /&gt;
analysableid,	 &lt;br /&gt;
split_part(timesplitting,&#039;\&#039;,5) AS &amp;quot;interval&amp;quot;,&lt;br /&gt;
/* sampleids,	*/&lt;br /&gt;
char_length(sampleids) - char_length(REPLACE(sampleids,&#039;,&#039;,&#039;&#039;))+1 AS &amp;quot;samples used&amp;quot;,&lt;br /&gt;
to_timestamp(timecreated) AS &amp;quot;time created&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_analytics_train_samples&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Analytics Used Analysables ===&lt;br /&gt;
Pulls data from the &amp;quot;analytics_used_analysables&amp;quot; table consisting of one row per context per model, noting whether the analysable was used to train the model or to make a prediction. This data is used to control the training and prediction processes.&lt;br /&gt;
Contributed by Elizabeth Dalton, Moodle HQ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
id,	 &lt;br /&gt;
modelid,	 &lt;br /&gt;
action,	 &lt;br /&gt;
analysableid,	 &lt;br /&gt;
to_timestamp(firstanalysis) AS &amp;quot;first analysis&amp;quot;,	 &lt;br /&gt;
to_timestamp(timeanalysed) AS &amp;quot;time analysed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_analytics_used_analysables&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Analytics Used Files ===&lt;br /&gt;
Pulls data from the &amp;quot;analytics_used_files&amp;quot; table consisting of one row per file per model, noting whether the file was used to train the model or to make a prediction. This data is used to control the training and prediction processes.&lt;br /&gt;
Contributed by Elizabeth Dalton, Moodle HQ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;br /&gt;
id,	 &lt;br /&gt;
modelid,	 &lt;br /&gt;
fileid,	 &lt;br /&gt;
action,	 &lt;br /&gt;
TO_TIMESTAMP(time) AS Time&lt;br /&gt;
&lt;br /&gt;
FROM prefix_analytics_used_files&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Average Cognitive Depth and Social Breadth===&lt;br /&gt;
&lt;br /&gt;
Here is a simple SQL snippet to calculate average cognitive depth and social breadth indicators for all students in the system. This one ignores  indicator values of 0, as they are nulls as defined in this model.&lt;br /&gt;
Contributed by Elizabeth Dalton, Moodle HQ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;br /&gt;
i.contextid,&lt;br /&gt;
i.sampleid,&lt;br /&gt;
&lt;br /&gt;
TRUNC(AVG(CASE&lt;br /&gt;
WHEN i.indicator LIKE &#039;%cognitive%&#039; THEN i.value &lt;br /&gt;
ELSE &#039;0&#039;&lt;br /&gt;
END),2) AS &amp;quot;Average Cognitive Depth&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
TRUNC(AVG(CASE&lt;br /&gt;
WHEN i.indicator LIKE &#039;%social%&#039; THEN i.value &lt;br /&gt;
ELSE &#039;0&#039;&lt;br /&gt;
END),2) AS &amp;quot;Average Social Breadth&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_analytics_indicator_calc as i&lt;br /&gt;
WHERE&lt;br /&gt;
i.value != 0&lt;br /&gt;
GROUP BY i.contextid, i.sampleid&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Competencies==&lt;br /&gt;
&lt;br /&gt;
===List of competencies from a framework and the courses including them===&lt;br /&gt;
Contributed by [https://moodle.org/user/profile.php?id=2049965 François Parlant]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
f.shortname AS &#039;Framework&#039;,&lt;br /&gt;
comp.shortname AS &#039;Competency&#039;, &lt;br /&gt;
cccomp.courseid AS &#039;Course id&#039;, &lt;br /&gt;
c.fullname AS &#039;Course name&#039;,&lt;br /&gt;
c.shortname AS &#039;Course code&#039;&lt;br /&gt;
FROM &lt;br /&gt;
prefix_competency_coursecomp AS cccomp &lt;br /&gt;
INNER JOIN prefix_competency AS comp ON cccomp.competencyid = comp.id&lt;br /&gt;
INNER JOIN prefix_course AS c ON cccomp.courseid = c.id&lt;br /&gt;
INNER JOIN prefix_competency_framework AS f ON comp.competencyframeworkid = f.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Count the courses using each competency from frameworks===&lt;br /&gt;
Contributed by [https://moodle.org/user/profile.php?id=2049965 François Parlant]&lt;br /&gt;
&lt;br /&gt;
Unfortunately, there is not a filter by competency framework.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
select &lt;br /&gt;
f.shortname AS framework,&lt;br /&gt;
comp.shortname AS &#039;Competency&#039;,&lt;br /&gt;
COUNT(cccomp.competencyid) AS &#039;nb course&#039;&lt;br /&gt;
FROM prefix_competency AS comp&lt;br /&gt;
INNER JOIN prefix_competency_framework AS f ON comp.competencyframeworkid = f.id&lt;br /&gt;
LEFT JOIN prefix_competency_coursecomp AS cccomp ON cccomp.competencyid = comp.id&lt;br /&gt;
GROUP BY comp.id, comp.shortname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scale details with ids ===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
Competency import and export files include scales with id numbers. However, the management page in Grades &amp;gt; Scales does not have the scale id, nor other useful details that scales store about themselves, like who made them and when, and what context they pertain to. This simple query shows you that information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
s.id AS Scaleid,&lt;br /&gt;
s.name AS Scale_Name,&lt;br /&gt;
s.scale AS Scale,&lt;br /&gt;
CASE  &lt;br /&gt;
  WHEN s.courseid = 0 THEN &#039;System&#039;&lt;br /&gt;
  ELSE (SELECT shortname FROM prefix_course WHERE id = s.courseid)&lt;br /&gt;
END AS Context,&lt;br /&gt;
CASE &lt;br /&gt;
  WHEN s.userid = 0 THEN &#039;System&#039;&lt;br /&gt;
  ELSE (SELECT username FROM prefix_user WHERE id = s.userid)&lt;br /&gt;
END AS User,&lt;br /&gt;
s.description,&lt;br /&gt;
DATE_FORMAT( FROM_UNIXTIME(s.timemodified), &#039;%Y-%m-%d %H:%i&#039; ) AS &#039;Modified&#039;&lt;br /&gt;
FROM prefix_scale s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syllabus==&lt;br /&gt;
&lt;br /&gt;
Our school simply asks teachers to drop a file (resource) on their course page&lt;br /&gt;
and rename this resource (not the file) starting with &amp;quot;syllabus&amp;quot; (case insensitive)&lt;br /&gt;
&lt;br /&gt;
===Count the number of resources whose name starts by &amp;quot;Syllabus&amp;quot;===&lt;br /&gt;
Contributed by [https://moodle.org/user/profile.php?id=2049965 François Parlant]&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
Select &lt;br /&gt;
r.name As &#039;Resource name&#039;,&lt;br /&gt;
cc.name AS &#039;Category&#039;,&lt;br /&gt;
CONCAT(&#039;&amp;lt;a href=&amp;quot;%%WWWROOT%%/pluginfile.php/&#039;, ct.id, &#039;/mod_resource/content/1/&#039;, f.filename, &#039;&amp;quot;&amp;gt;&#039;,f.filename,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Clickable filename&#039;,&lt;br /&gt;
&lt;br /&gt;
c.fullname AS &#039;Course name&#039;,&lt;br /&gt;
c.shortname AS &#039;Course shortname&#039;,&lt;br /&gt;
&lt;br /&gt;
# the date filters are connected to this &amp;quot;last modif&amp;quot; field&lt;br /&gt;
# userful to check if the syllabus has been updated this year&lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(f.timemodified), &#039;%e %b %Y&#039;) AS &#039;last modif&#039;, &lt;br /&gt;
&lt;br /&gt;
# tell if the file is visible by the students or hidden&lt;br /&gt;
IF(cm.visible=0,&amp;quot;masqué&amp;quot;,&amp;quot;visible&amp;quot;) AS &#039;Visibility&#039;,&lt;br /&gt;
&lt;br /&gt;
# next line tries to give the real path (local path) if you want to create a zip file using an external script)&lt;br /&gt;
# notice that the path is in the column &amp;quot;contenthash&amp;quot; and NOT in the column pathhash&lt;br /&gt;
# if the contenthash starts with 9af3... then the file is stored in moodledata/filedir/9a/f3/contenthash&lt;br /&gt;
# I try to get the path to moodledata from the value of the geoip variable in the mdl_config table... maybe a bad idea&lt;br /&gt;
CONCAT(&#039;&amp;quot;&#039;,(Select left(value, length(value)-25) from prefix_config where name =&amp;quot;geoip2file&amp;quot;),&#039;/filedir/&#039;, left(f.contenthash,2), &amp;quot;/&amp;quot;,substring(f.contenthash,3,2),&#039;/&#039;, f.contenthash, &#039;&amp;quot;&#039;) AS &#039;link&#039;&lt;br /&gt;
&lt;br /&gt;
FROM prefix_resource AS r&lt;br /&gt;
INNER JOIN prefix_course_modules AS cm ON cm.instance = r.id&lt;br /&gt;
INNER JOIN prefix_course AS c ON c.id = r.course&lt;br /&gt;
INNER JOIN prefix_context AS ct ON ct.instanceid = cm.id&lt;br /&gt;
JOIN prefix_course_categories cc ON c.category = cc.id&lt;br /&gt;
INNER JOIN prefix_files AS f ON f.contextid = ct.id AND f.mimetype IS NOT NULL AND f.component = &#039;mod_resource&#039;&lt;br /&gt;
WHERE LOWER( r.name) LIKE &#039;syllabus%&#039;&lt;br /&gt;
%%FILTER_STARTTIME:f.timemodified:&amp;gt;%% %%FILTER_ENDTIME:f.timemodified:&amp;lt;%%&lt;br /&gt;
%%FILTER_SUBCATEGORIES:cc.path%%&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List files which have been tagged &amp;quot;Syllabus&amp;quot;===&lt;br /&gt;
Contributed by [https://moodle.org/user/profile.php?id=2049965 François Parlant]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
Select &lt;br /&gt;
t.rawname AS &#039;rawtag&#039;,&lt;br /&gt;
c.shortname AS &#039;Cours shortname&#039;,&lt;br /&gt;
c.fullname AS &#039;Course name&#039;,&lt;br /&gt;
r.name As &#039;Resource name&#039;,&lt;br /&gt;
CONCAT(&#039;&amp;lt;a href=&amp;quot;%%WWWROOT%%/pluginfile.php/&#039;, ti.contextid, &#039;/mod_resource/content/1/&#039;, f.filename, &#039;&amp;quot;&amp;gt;cliquez ici&amp;lt;/a&amp;gt;&#039;) AS &#039;link&#039;,&lt;br /&gt;
ti.contextid AS &#039;Instance for link&#039;,&lt;br /&gt;
f.id AS &#039;file id&#039; &lt;br /&gt;
FROM prefix_tag_instance AS ti&lt;br /&gt;
INNER JOIN prefix_tag AS t ON ti.tagid = t.id&lt;br /&gt;
INNER JOIN prefix_course_modules AS cm ON ti.itemid = cm.id&lt;br /&gt;
INNER JOIN prefix_course AS c ON cm.course = c.id&lt;br /&gt;
INNER JOIN prefix_resource AS r ON r.id = cm.instance&lt;br /&gt;
INNER JOIN prefix_files AS f ON f.contextid = ti.contextid AND f.mimetype IS NOT NULL&lt;br /&gt;
WHERE t.rawname = &#039;Syllabus&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List of courses WITHOUT a resource with a name starting by &amp;quot;syllabus&amp;quot;===&lt;br /&gt;
Contributed by [https://moodle.org/user/profile.php?id=2049965 François Parlant]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
select c.id, c.shortname,&lt;br /&gt;
CONCAT(&#039;&amp;lt;a href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;, c.id, &#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Course link&#039;&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
LEFT JOIN (&lt;br /&gt;
  Select r.course &lt;br /&gt;
  from prefix_resource AS r&lt;br /&gt;
  WHERE LOWER( r.name) LIKE &#039;syllabus%&#039;&lt;br /&gt;
  GROUP BY r.course) AS r ON r.course = c.id&lt;br /&gt;
INNER JOIN prefix_course_categories cc ON c.category = cc.id&lt;br /&gt;
WHERE r.course IS NULL &lt;br /&gt;
%%FILTER_SUBCATEGORIES:cc.path%%&lt;br /&gt;
%%FILTER_STARTTIME:c.startdate:&amp;gt;%% %%FILTER_ENDTIME:c.enddate:&amp;lt;%%&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List of courses have MULTIPLE resource with a name like &amp;quot;Syllabus%&amp;quot;===&lt;br /&gt;
Contributed by [https://moodle.org/user/profile.php?id=2049965 François Parlant]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
select &lt;br /&gt;
r.course,&lt;br /&gt;
c.shortname,&lt;br /&gt;
CONCAT(&#039;&amp;lt;a href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;, r.id, &#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS &#039;Course link&#039;&lt;br /&gt;
FROM prefix_resource AS r&lt;br /&gt;
INNER JOIN prefix_course AS c ON c.id = r.course&lt;br /&gt;
JOIN prefix_course_categories cc ON c.category = cc.id&lt;br /&gt;
WHERE LOWER( r.name) LIKE &#039;syllabus%&#039;&lt;br /&gt;
GROUP BY r.course HAVING count(r.course)&amp;gt;1&lt;br /&gt;
%%FILTER_SUBCATEGORIES:cc.path%%&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Chat==&lt;br /&gt;
&lt;br /&gt;
===List the chats===&lt;br /&gt;
Contributed by [https://moodle.org/user/profile.php?id=2049965 François Parlant]&lt;br /&gt;
This report gives the list of all chats with the name of the course and various ids needed for further queries.&lt;br /&gt;
&lt;br /&gt;
The column &amp;quot;participants&amp;quot; is intended to work with an (optional) secondary report. If you don&#039;t need it , you can erase it.&lt;br /&gt;
It produces a direct link to another (optional) report which will give you the current participants list to this chat.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
select &lt;br /&gt;
c.shortname,&lt;br /&gt;
c.fullname,&lt;br /&gt;
ch.course, &lt;br /&gt;
ch.id,&lt;br /&gt;
# if you intend to use a secondary report to see the participants of a specific chat&lt;br /&gt;
# create the secondary report, check the id of the report in the url, and change the 21 in next line to your participant report&#039;s id&lt;br /&gt;
CONCAT(&#039;&amp;lt;a href=&amp;quot;%%WWWROOT%%/blocks/configurable_reports/viewreport.php?id=21&amp;amp;filter_courses=&#039;, ch.id,&#039;&amp;quot;&amp;gt;Chat participants&amp;lt;/a&amp;gt;&#039;) AS &#039;Course link&#039;,&lt;br /&gt;
ch.chattime&lt;br /&gt;
&lt;br /&gt;
FROM&lt;br /&gt;
prefix_chat ch&lt;br /&gt;
INNER JOIN prefix_course c ON c.id = ch.course&lt;br /&gt;
&lt;br /&gt;
ORDER BY ch.chattime, c.fullname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
===Participants to a chat (optional secondary report)===&lt;br /&gt;
This version of the participant list is intended to work with a link given in the previous report.&lt;br /&gt;
* User opens the report listing all the chats on the platform&lt;br /&gt;
* user clicks on the link from the column &amp;quot;chat participant&amp;quot; &lt;br /&gt;
* which open this report with a filter on the chatid&lt;br /&gt;
&#039;&#039;(careful, we are tweaking the coursefilter to carry instead the chatid: the displayed &amp;quot;course filter&amp;quot; will not work! but we need it)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SELECT&lt;br /&gt;
c.id AS courseid,&lt;br /&gt;
chu.chatid,&lt;br /&gt;
chu.userid AS &#039;chat user userid&#039;,&lt;br /&gt;
c.fullname,&lt;br /&gt;
u.username,&lt;br /&gt;
u.firstname,&lt;br /&gt;
u.lastname,&lt;br /&gt;
u.email&lt;br /&gt;
                                &lt;br /&gt;
FROM&lt;br /&gt;
prefix_user u &lt;br /&gt;
LEFT JOIN prefix_chat_users chu ON chu.userid = u.id&lt;br /&gt;
INNER JOIN prefix_course c ON c.id = chu.course&lt;br /&gt;
&lt;br /&gt;
WHERE 1=1&lt;br /&gt;
%%FILTER_COURSES:chu.chatid%%&lt;br /&gt;
# you can also filter by course&lt;br /&gt;
# but don&#039;t put comment line between where and filter&lt;br /&gt;
# %%FILTER_COURSES:chu.course%%&lt;br /&gt;
&lt;br /&gt;
                                &lt;br /&gt;
ORDER BY c.fullname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List current participants to chat===&lt;br /&gt;
Contributed by [https://moodle.org/user/profile.php?id=2049965 François Parlant]&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
c.id AS courseid,&lt;br /&gt;
chu.chatid,&lt;br /&gt;
chu.userid AS &#039;chat user userid&#039;,&lt;br /&gt;
c.fullname,&lt;br /&gt;
u.username,&lt;br /&gt;
u.firstname,&lt;br /&gt;
u.lastname,&lt;br /&gt;
u.email&lt;br /&gt;
                                &lt;br /&gt;
FROM&lt;br /&gt;
prefix_user u &lt;br /&gt;
LEFT JOIN prefix_chat_users chu ON chu.userid = u.id&lt;br /&gt;
INNER JOIN prefix_course c ON c.id = chu.course&lt;br /&gt;
&lt;br /&gt;
WHERE 1=1&lt;br /&gt;
%%FILTER_COURSES:chu.course%%&lt;br /&gt;
                                &lt;br /&gt;
ORDER BY c.fullname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful sub queries ==&lt;br /&gt;
&lt;br /&gt;
IN this section please put any short one purpose sub queries that show how common procedures often useful as part of larger queries.&lt;br /&gt;
&lt;br /&gt;
=== All teachers in the course ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This snippet shows how to get teachers from a course. The contextevel for course objects is 50. And the default Teacher role is role id 3.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
,(SELECT GROUP_CONCAT( CONCAT( u.firstname,  &amp;quot; &amp;quot;, u.lastname ) ) &lt;br /&gt;
FROM prefix_course ic&lt;br /&gt;
JOIN prefix_context con ON con.instanceid = ic.id&lt;br /&gt;
JOIN prefix_role_assignments ra ON con.id = ra.contextid AND con.contextlevel = 50&lt;br /&gt;
JOIN prefix_role r ON ra.roleid = r.id&lt;br /&gt;
JOIN prefix_user u ON u.id = ra.userid&lt;br /&gt;
WHERE r.id = 3 AND ic.id = c.id&lt;br /&gt;
GROUP BY ic.id&lt;br /&gt;
) AS TeacherNames&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get custom User profile fields for a user ===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
This snippet of code shows how to connect a user with their custom profile field data. This will list all users with all custom profile fields and data. Custom profile fields have two tables, one for the definition of the profile field (user_info_field) and its settings, and a separate table to hold the data entered by users (user_info_data). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.username, uif.name, uid.data&lt;br /&gt;
FROM prefix_user AS u&lt;br /&gt;
JOIN prefix_user_info_data AS uid ON uid.userid = u.id&lt;br /&gt;
JOIN prefix_user_info_field AS uif ON uid.fieldid = uif.id &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to limit it to one of those fields, you can restrict it by shortname of the custom profile field, so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.username, uif.name, uid.data&lt;br /&gt;
FROM prefix_user AS u&lt;br /&gt;
JOIN prefix_user_info_data AS uid ON uid.userid = u.id&lt;br /&gt;
JOIN prefix_user_info_field AS uif ON (uid.fieldid = uif.id AND uif.shortname = &#039;shortname1&#039;)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will show you only the data from the custom profile field with the shortname &#039;shortname1&#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to do this with two or more custom profile fields, you will need to have a JOIN and table alias for each with a restriction for each profile field shortname. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.username, d1.data AS &#039;Profile One&#039;, d2.data As &#039;Profile Two&#039;&lt;br /&gt;
FROM prefix_user u&lt;br /&gt;
JOIN prefix_user_info_data d1 ON d1.userid = u.id&lt;br /&gt;
JOIN prefix_user_info_field f1 ON d1.fieldid = f1.id AND f1.shortname = &#039;shortname1&#039;&lt;br /&gt;
JOIN prefix_user_info_data d2 ON d2.userid = u.id&lt;br /&gt;
JOIN prefix_user_info_field f2 ON d2.fieldid = f2.id AND f2.shortname = &#039;shortname2&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== NOTE: Alternate Method ====&lt;br /&gt;
&lt;br /&gt;
If you have more than a couple of fields you need to use, then this query may time out or not return data due to too many joins. The limit seems to be around 10 custom profile fields. &lt;br /&gt;
&lt;br /&gt;
Instead you should use an alternate method which uses Subselects for each of the profile fields. Details and sample code are in this forum discussion: https://moodle.org/mod/forum/discuss.php?d=355502#p1434854. A sample of the style is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.username&lt;br /&gt;
&lt;br /&gt;
,(SELECT d1.data FROM prefix_user_info_data d1&lt;br /&gt;
 JOIN prefix_user_info_field f1 ON d1.fieldid = f1.id AND f1.shortname = &#039;shortname1&#039;&lt;br /&gt;
 WHERE d1.userid = u.id&lt;br /&gt;
) AS thefirstfield&lt;br /&gt;
&lt;br /&gt;
,(SELECT d1.data FROM prefix_user_info_data d1&lt;br /&gt;
 JOIN prefix_user_info_field f1 ON d1.fieldid = f1.id AND f1.shortname = &#039;shortname2&#039;&lt;br /&gt;
 WHERE d1.userid = u.id&lt;br /&gt;
) AS thesecondfield&lt;br /&gt;
&lt;br /&gt;
FROM prefix_user u&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How to use Configurable Reports Date Time Filters===&lt;br /&gt;
&lt;br /&gt;
Contributed by: [https://moodle.org/user/profile.php?id=88992 Randy Thornton]&lt;br /&gt;
&lt;br /&gt;
In the Configurable Reports block, you can set the Time and Date filter to allow you to pick your report Start date/time and End date/time interactively. This will work on any column in a table that is a timestamp.&lt;br /&gt;
&lt;br /&gt;
Here is a simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.username, &lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(u.firstaccess),&#039;%Y-%m-%d %H:%i&#039;) AS &#039;FirstAccess&#039;,&lt;br /&gt;
DATE_FORMAT(FROM_UNIXTIME(u.lastaccess),&#039;%Y-%m-%d %H:%i&#039;) AS &#039;LastAccess&#039;   &lt;br /&gt;
FROM prefix_user u&lt;br /&gt;
&lt;br /&gt;
WHERE 1=1&lt;br /&gt;
%%FILTER_STARTTIME:u.firstaccess:&amp;gt;%% &lt;br /&gt;
%%FILTER_ENDTIME:u.lastaccess:&amp;lt;%% &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1) You will need to replace name of the table and column for the filter to use the time and date column you need for your query. In the example above, it filters on the firstaccess and lastaccess columns in the user table. If you were doing a report on course completion, you might put the timecompleted column, and so forth.&lt;br /&gt;
&lt;br /&gt;
2) You MUST then add the Start / End date filter on the Filters tab of the Report. If you don&#039;t, the report will still run, probably, but the filter will be ignored.&lt;br /&gt;
&lt;br /&gt;
Note: the WHERE 1=1 statement is a peculiarity of the filters in Config reports: if you don&#039;t have a WHERE statement in your query already, then you must add this dummy WHERE to keep the statement valid. If you already have a WHERE statement in your code, simply add the %%FILTER%% placeholders after it (and before any GROUP or ORDER BY statements.)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [https://github.com/jleyva/moodle-configurable_reports_repository Configurable Reports Repository on GitHub]&lt;br /&gt;
* [https://moodleschema.zoola.io/index.html Moodle DB schema explorer] - searching and filtering tables, fields and external key connections between tables.&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributed code]]&lt;br /&gt;
&lt;br /&gt;
[[es:Reportes específicos hechos por usuarios]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Microsoft_365&amp;diff=138911</id>
		<title>Microsoft 365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Microsoft_365&amp;diff=138911"/>
		<updated>2021-07-30T15:48:13Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams https://moodle.org/plugins/assignsubmission_onenote https://moodle.org/plugins/assignfeedback_onenote&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Microsoft 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Microsoft 365 authentication and basic OneDrive repository support, the Microsoft 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Microsoft 365 plugin suite:&lt;br /&gt;
* User sync from Microsoft 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Microsoft 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Microsoft 365 group/teams sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Microsoft 365 plugins, you need the following:&lt;br /&gt;
* A Microsoft 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 and above. Features available in each version, and the support status vary.&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Microsoft 365 set of plugins contains 6 core plugins, and 3 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 5 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Microsoft 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication type, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features:&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication.&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants.&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** User profile field mapping&lt;br /&gt;
**** User profiles can be mapped and synced from IdP to Moodle.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Microsoft 365 integration back-end. It provides shared code to communicate with Microsoft 365, and powers the calendar sync.&lt;br /&gt;
** Features:&lt;br /&gt;
*** Calendar sync from/to Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Microsoft 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Microsoft 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features:&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 3 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
= Resources =&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
= Setup =&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Microsoft 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see [[Installing plugins]]&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints.&lt;br /&gt;
## These should be set by default to the following values:&lt;br /&gt;
##* &#039;&#039;&#039;Authorization Endpoint&#039;&#039;&#039;: &amp;lt;nowiki&amp;gt;https://login.microsoftonline.com/common/oauth2/authorize&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
##* &#039;&#039;&#039;Token Endpoint&#039;&#039;&#039;: &amp;lt;nowiki&amp;gt;https://login.microsoftonline.com/common/oauth2/token&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
## It&#039;s also possible to replace the &amp;quot;common&amp;quot; part in the endpoints to be your tenant name or tenant GUID. By doing so, users who are redirected to Microsoft login pages (using the auth code login flow) will see the custom login page of your tenant if one is [https://docs.microsoft.com/en-us/microsoft-365/admin/setup/customize-sign-in-page?view=o365-worldwide configured following instructions]. e.g.&lt;br /&gt;
##* &#039;&#039;&#039;Authorization Endpoint&#039;&#039;&#039;: &amp;lt;nowiki&amp;gt;https://login.microsoftonline.com/sample.onmicrosoft.com/oauth2/authorize&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
##* &#039;&#039;&#039;Token Endpoint&#039;&#039;&#039;: &amp;lt;nowiki&amp;gt;https://login.microsoftonline.com/sample.onmicrosoft.com/oauth2/token&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
## Note the endpoints may be in different format for B2C tenants. Please verify it in your Azure AD portal.&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure portal later, so note this value and put it aside.&lt;br /&gt;
#* For example, https://www.example.com/auth/oidc/&lt;br /&gt;
#* Notes:&lt;br /&gt;
#*# This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any reason, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
#*# This URI must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
#*# The Moodle site&#039;s configured URL must use HTTPS, even with a self signed SSL cert. Redirect URI using HTTP will not be acceptable when creating Azure app for the integration.&lt;br /&gt;
#*# If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
#*# This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
=== Prepare your Microsoft 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Microsoft 365 for SSO, you must configure Microsoft Azure to manage your Microsoft 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
#* If you followed steps above to create the Azure app, you should be redirected to the app settings page already.&lt;br /&gt;
#* Otherwise:&lt;br /&gt;
#*# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
#*# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
#*# Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
#*# Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
#*# Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;.&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;.&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this value (write it down or copy it somewhere) and set it aside. You&#039;ll need it later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &#039;&#039;&#039;Set&#039;&#039;&#039; link next to &#039;&#039;&#039;Application ID URI&#039;&#039;&#039;.&lt;br /&gt;
## This should open a &#039;&#039;&#039;Set the APP ID URI&#039;&#039;&#039; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://&#039;&#039;&#039;URL.TO.MOODLE&#039;&#039;&#039;/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &#039;&#039;&#039;Save&#039;&#039;&#039; to create the Application ID URI.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a scope&#039;&#039;&#039;.&lt;br /&gt;
## Enter &#039;&#039;&#039;access_as_user&#039;&#039;&#039; as scope name.&lt;br /&gt;
## Set &#039;&#039;&#039;Who can consent?&#039;&#039;&#039; to &#039;&#039;&#039;Admins and users&#039;&#039;&#039;.&lt;br /&gt;
## Set &#039;&#039;&#039;Admin consent title&#039;&#039;&#039; to &#039;&#039;&#039;Teams can access the user’s profile&#039;&#039;&#039;.&lt;br /&gt;
## Set &#039;&#039;&#039;Admin consent description&#039;&#039;&#039; to &#039;&#039;&#039;Allows Teams to call the app’s web APIs as the current user&#039;&#039;&#039;.&lt;br /&gt;
## Set &#039;&#039;&#039;User consent title&#039;&#039;&#039; to &#039;&#039;&#039;Teams can access the user profile and make requests on the user&#039;s behalf&#039;&#039;&#039;.&lt;br /&gt;
## Set &#039;&#039;&#039;User consent description&#039;&#039;&#039; to &#039;&#039;&#039;Enable Teams to call this app’s APIs with the same rights as the user&#039;&#039;&#039;.&lt;br /&gt;
## Ensure that &#039;&#039;&#039;State&#039;&#039;&#039; is set to be &#039;&#039;&#039;Enabled&#039;&#039;&#039;.&lt;br /&gt;
## Select the &#039;&#039;&#039;Add scope&#039;&#039;&#039; button to save.&lt;br /&gt;
## In the &#039;&#039;&#039;Authorized client applications&#039;&#039;&#039; section, identify the applications that you want to authorize for your app’s web application. Select &#039;&#039;&#039;Add a client application&#039;&#039;&#039;. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
##* &#039;&#039;&#039;&amp;lt;code&amp;gt;1fec8e78-bce4-4aaf-ab1b-5451cc387264&amp;lt;/code&amp;gt;&#039;&#039;&#039; (Teams mobile/desktop application)&lt;br /&gt;
##* &#039;&#039;&#039;&amp;lt;code&amp;gt;5e3ce6c0-2b1f-4285-8d4b-75ee78787346&amp;lt;/code&amp;gt;&#039;&#039;&#039; (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &#039;&#039;&#039;Microsoft Graph&#039;&#039;&#039;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &#039;&#039;&#039;Application&#039;&#039;&#039; and &#039;&#039;&#039;Delegated&#039;&#039;&#039; permissions sections according to the section below.&lt;br /&gt;
## After all the permissions are added, click the &#039;&#039;&#039;Grant admin consent for YOUR ORGANISATION NAME&#039;&#039;&#039; link.&lt;br /&gt;
## When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
===== Azure app permissions =====&lt;br /&gt;
The integration uses various [https://docs.microsoft.com/en-us/graph/overview Microsoft Graph APIs] to communicate with Microsoft 365 to get and set data. Each Graph API would require a different set of app permissions. The integration provides a list of recommended permissions to be given to ensure all features in the integration works, all of which are added automatically by the PowerShell script if it&#039;s used. Advanced users can customise the permissions according to the need of their own organisation, e.g. if group/team integration is not used, all permissions related to group can be removed, e.g. Group.ReadWrite.All.&lt;br /&gt;
====== Application permissions vs delegated permissions ======&lt;br /&gt;
In general, if the Moodle site uses the &#039;&#039;&#039;Application access&#039;&#039;&#039; connection method, giving only application permissions would be enough; if the Moodle site uses the &#039;&#039;&#039;System API user&#039;&#039;&#039; connection method, only delegated permission are required.&lt;br /&gt;
&lt;br /&gt;
Note the following exception:&lt;br /&gt;
* &#039;&#039;&#039;User.Read&#039;&#039;&#039; delegated permission is always required regardless of connection method.&lt;br /&gt;
* If teams integration feature is used, the following delegated permissions are required for teams SSO to work, regardless of connection method:&lt;br /&gt;
** &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
* As of release 3.9.6 and 3.10.3 release of the plugins in June 2021, there are a small number of Microsoft Graph APIs used in the integration making calls to the &amp;quot;/me/&amp;quot; path, which would require the corresponding delegated permissions regardless of connection method. A plan is in place to replace calls like this in the next release, so that these delegated permissions can be removed. The delegated permissions affected are:&lt;br /&gt;
** &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039; for calendar sync.&lt;br /&gt;
** &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039; and &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039; for OneDrive integration.&lt;br /&gt;
** &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039; for OneNote integration.&lt;br /&gt;
====== Permissions ======&lt;br /&gt;
For a full list of Microsoft Graph API used, and the permissions required, please refer to [https://docs.google.com/spreadsheets/d/1XIFnnQ8RuFjlPGB8CiiMmK8x9Uta9XIR_icvAdx0G6k this spreadsheet]. Note that:&lt;br /&gt;
* This document is constantly updated.&lt;br /&gt;
* For each Graph API, a few permissions may be listed. Graph API can be called if permissions in any line is added, and the admin consent is granted for your organisation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The recommended permissions to ensure all integration features work are listed below. These would be the same set of permissions that are applied when using the PowerShell script to set up the Azure app.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;10&amp;quot; | Application Permissions&lt;br /&gt;
|&#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| A common permission used in both user syncs and group integration.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| A common permission used in both user syncs and group integration.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group/team integration.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;User.Read.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required for SSO and to sync user information between Microsoft 365 and Moodle.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Microsoft 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
|Required to detect OneDrive for Business URL setting.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;AppRoleAssignment.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Manage app permission grants and app role assignments&#039;&#039;&#039;&lt;br /&gt;
| Required for assigning users to application during user sync if the option is enabled. &lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;16&amp;quot; |Delegated Permissions&lt;br /&gt;
|&#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| A common permission used in both user syncs and group integration.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| A common permission used in both user syncs and group integration.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;User.Read.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
|Required for SSO and to sync user information between Microsoft 365 and Moodle.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Have full access to all files user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the Microsoft 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;AppRoleAssignment.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Manage app permission grants and app role assignments&#039;&#039;&#039;&lt;br /&gt;
|Required for assigning users to application during user sync if the option is enabled. &lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Microsoft 365, and to access Microsoft 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
=== Configure the Microsoft 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Microsoft 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Microsoft 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Microsoft 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
== Connecting users to Microsoft 365 ==&lt;br /&gt;
To use any Microsoft 365 features, a Moodle user must be connected to a Microsoft 365 user that has an active Microsoft 365 subscription. There are two ways to connect a Moodle user to a Microsoft 365 user.&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Microsoft 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
=== Link a Moodle user to a Microsoft 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Microsoft 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Microsoft 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Microsoft 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Microsoft 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Microsoft 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Microsoft 365 user.&lt;br /&gt;
= Microsoft 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Microsoft 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Microsoft 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Microsoft 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Microsoft 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Microsoft 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Microsoft 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Microsoft 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Microsoft 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced.&lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to a Microsoft 365 group, enabling all group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Microsoft 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Microsoft 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Microsoft 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to a Microsoft 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Microsoft 365 user, only a group will be created.&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Microsoft 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Microsoft 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Microsoft 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Microsoft 365 accounts. Each user in the system is listed alongside the Microsoft 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Microsoft 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Microsoft 365 username, and a 1 or 0 indicating whether to enable Microsoft 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
**&#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Microsoft 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Microsoft 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;: This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Microsoft 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Microsoft 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 for China&#039;&#039;&#039;: Microsoft 365 in China differs slightly in some technical aspects. If you are using Microsoft 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Microsoft 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Microsoft 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Microsoft 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Microsoft 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Microsoft 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Microsoft 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Microsoft 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Microsoft 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Microsoft 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Microsoft 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
== Switching existing Moodle users to use Microsoft 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Microsoft 365.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Microsoft 365 Login&#039;&#039; link under &#039;&#039;&#039;Microsoft 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Microsoft 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Microsoft 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Microsoft 365, you will not have to enter your credentials on the Microsoft 365 login page. This Microsoft 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Microsoft 365 first to show the Microsoft 365 login screen.&lt;br /&gt;
# The Moodle account will now use Microsoft 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Microsoft 365 features in Moodle.&lt;br /&gt;
== Connecting existing Moodle users to Microsoft 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Microsoft 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Microsoft 365, you will not have to enter your credentials on the Microsoft 365 login page. This Microsoft 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Microsoft 365 first to show the Microsoft 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Microsoft 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Microsoft 365 account and can use Microsoft 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Microsoft 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
# Start as a user connected to Microsoft 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Microsoft 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Microsoft 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Microsoft 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
= Notes on special release =&lt;br /&gt;
== 3.8.0.4 and 3.9.1 release==&lt;br /&gt;
3.8.0.4 and 3.9.1 release of the plugins on 29 September 2020 introduced improvements on SSO integration for Moodle in Teams as well as Single Sign Off support, but requires additional actions from Moodle and Azure admins.&lt;br /&gt;
=== Moodle and Teams SSO integration ===&lt;br /&gt;
The new releases is capable of getting a user token from either Teams desktop/mobile app or Teams web app, and attempt to log in as the user in the Moodle Teams tab. In order for it to work, changes in 3 sections are required.&lt;br /&gt;
==== Update Azure app settings ====&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Microsoft 365 integration, and click its name.&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039;, select &#039;&#039;&#039;Expose an API&#039;&#039;&#039;.&lt;br /&gt;
# Select the &amp;quot;Set&amp;quot; link to generate the Application ID URI in the form of api://{AppID}. Insert your fully qualified domain name (with a forward slash &amp;quot;/&amp;quot; appended to the end) between the double forward slashes and the GUID. The entire ID should have the form of: api://fully-qualified-domain-name.com/{AppID}. e.g. api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000.&lt;br /&gt;
# If you get errors when selecting the &amp;quot;Set&amp;quot; link, it may be because the &#039;&#039;&#039;Supported account types&#039;&#039;&#039; setting of your app is set to a value rather than the one with &amp;quot;single tenant&amp;quot;. Try updating this value to get it working.&lt;br /&gt;
# Select the &amp;quot;Add a scope&amp;quot; button. In the panel that opens:&lt;br /&gt;
## enter &amp;quot;access_as_user&amp;quot; as the &amp;quot;Scope name&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to be &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to be &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to be &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to be &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;.&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
# In the Authorized client applications section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
## 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
## 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;API permissions&#039;&#039;&#039;, ensure the following permissions are added under &amp;quot;Microsoft Graph&amp;quot; &amp;gt; &amp;quot;Delegated permissions&amp;quot;:&lt;br /&gt;
## User.Read (enabled by default)&lt;br /&gt;
## email&lt;br /&gt;
## offline_access&lt;br /&gt;
## OpenId&lt;br /&gt;
## profile&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;Authentication&#039;&#039;&#039;, ensure the following boxes are checked for &amp;quot;implicit grant&amp;quot;:&lt;br /&gt;
## ID Token&lt;br /&gt;
## Access Token.&lt;br /&gt;
==== Download updated manifest file ====&lt;br /&gt;
# Login to Moodle as site administrator.&lt;br /&gt;
# Go to &amp;quot;Microsoft 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Teams Settings&amp;quot; tab.&lt;br /&gt;
# Verify settings on the page, note that two new settings are added in this release:&lt;br /&gt;
## &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039;: This is used in the &amp;quot;ID&amp;quot; field of [https://docs.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema Teams app manifest file], which is essentially a self generated app ID to identify itself. It should be set to the default value in most use cases, otherwise it may affect upgrading of the Teams app. The only scenario a custom value is to be set for this setting is when there are multiple Moodle sites in the organisation, and they all need to be integrated with Teams, thus each site will require a separate Teams app. If custom value is required, please use [https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7 powershell] or [https://www.guidgenerator.com/ external tools] to generate valid ones.&lt;br /&gt;
## &#039;&#039;&#039;Teams app name&#039;&#039;&#039;: This allows you to give a custom name, rather than the default &amp;quot;Moodle&amp;quot;, to the Moodle Teams app created. It can be useful if you have multiple Moodle sites in your organisation, and each creating a separate Moodle app for Teams integration.&lt;br /&gt;
# Once settings are verified, save changes, go back to the tab, and click the &amp;quot;Download manifest file&amp;quot; button to download the new manifest file for the upgraded app.&lt;br /&gt;
==== Update Moodle app in Teams ====&lt;br /&gt;
# As a tenant admin, go to Teams.&lt;br /&gt;
# Go to &amp;quot;Apps&amp;quot; page to manage apps.&lt;br /&gt;
# From the menu on the left, click on the link &amp;quot;Built for YOUR ORGANISATION&amp;quot;. This should list all custom apps uploaded for your tenant.&lt;br /&gt;
# Locate the previous Moodle app, click the options button on the card for more options, and click &amp;quot;update&amp;quot;. This should open a file picker.&lt;br /&gt;
# Select the new manifest file downloaded from Moodle.&lt;br /&gt;
Note that as long as the &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039; setting is not changed, this should be recognised as an app upgrade, rather than uploading a new app. This means that the app will be kept in all existing Teams that have it installed, and all existing Moodle tabs will keep working.&lt;br /&gt;
=== Single Sign Off ===&lt;br /&gt;
When a Microsoft 365 authenticated user clicks the Moodle log out button, it is possible to log the user out from Microsoft 365 at the same time.&lt;br /&gt;
&lt;br /&gt;
In order for this to work, configuration changes in two places are required:&lt;br /&gt;
==== Moodle settings change ====&lt;br /&gt;
# Sign in Moodle as site admin.&lt;br /&gt;
# Go to &amp;quot;OpenID Connect&amp;quot; settings page under Plugins - Authentication:&lt;br /&gt;
# Go to &amp;quot;Advanced&amp;quot; tab.&lt;br /&gt;
# Enable &amp;quot;Single sign off&amp;quot;.&lt;br /&gt;
# Save changes.&lt;br /&gt;
==== Azure app settings change ====&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Microsoft 365 integration, and click its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the root URL of your Moodle site (wwwroot) as an entry.&lt;br /&gt;
== 3.8.0.5 and 3.9.2 release==&lt;br /&gt;
3.8.0.5 and 3.9.2 release of the plugins on 18 November 2020 added support for synching the default timezone preference of the user in Outlook to Moodle. This requires the following permissions to be granted for the Azure app.&lt;br /&gt;
* If your Moodle site uses &#039;&#039;&#039;Application access&#039;&#039;&#039; connection method, you will need to add and grant &#039;&#039;&#039;MailboxSettings.Read application permission&#039;&#039;&#039;.&lt;br /&gt;
* If your Moodle site uses &#039;&#039;&#039;System API User&#039;&#039;&#039; connection method, you will need to add and grant &#039;&#039;&#039;MailboxSettings.Read delegated permission&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Teams integration known limitations ==&lt;br /&gt;
&lt;br /&gt;
* If the Moodle site is not publicly accessible, e.g. on a intranet, Moodle tabs will not work in Teams desktop and mobile apps. They will only work in web apps from browser.&lt;br /&gt;
&lt;br /&gt;
* It is a known issue that if a Microsoft 365 user has never login to Moodle ever, the first attempt of the user to SSO from Teams to Moodle will not work silently. Instead, the user will need to click a button from the prompt to login.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Microsoft_365&amp;diff=138910</id>
		<title>Microsoft 365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Microsoft_365&amp;diff=138910"/>
		<updated>2021-07-29T11:49:04Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams https://moodle.org/plugins/assignsubmission_onenote https://moodle.org/plugins/assignfeedback_onenote&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Microsoft 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Microsoft 365 authentication and basic OneDrive repository support, the Microsoft 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Microsoft 365 plugin suite:&lt;br /&gt;
* User sync from Microsoft 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Microsoft 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Microsoft 365 group/teams sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Microsoft 365 plugins, you need the following:&lt;br /&gt;
* A Microsoft 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 and above. Features available in each version, and the support status vary.&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Microsoft 365 set of plugins contains 6 core plugins, and 3 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 5 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Microsoft 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication type, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features:&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication.&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants.&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** User profile field mapping&lt;br /&gt;
**** User profiles can be mapped and synced from IdP to Moodle.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Microsoft 365 integration back-end. It provides shared code to communicate with Microsoft 365, and powers the calendar sync.&lt;br /&gt;
** Features:&lt;br /&gt;
*** Calendar sync from/to Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Microsoft 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Microsoft 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features:&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 3 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
= Resources =&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
= Setup =&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Microsoft 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see [[Installing plugins]]&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints.&lt;br /&gt;
## These should be set by default to the following values:&lt;br /&gt;
##* &#039;&#039;&#039;Authorization Endpoint&#039;&#039;&#039;: &amp;lt;nowiki&amp;gt;https://login.microsoftonline.com/common/oauth2/authorize&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
##* &#039;&#039;&#039;Token Endpoint&#039;&#039;&#039;: &amp;lt;nowiki&amp;gt;https://login.microsoftonline.com/common/oauth2/token&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
## It&#039;s also possible to replace the &amp;quot;common&amp;quot; part in the endpoints to be your tenant name or tenant GUID. By doing so, users who are redirected to Microsoft login pages (using the auth code login flow) will see the custom login page of your tenant if one is [https://docs.microsoft.com/en-us/microsoft-365/admin/setup/customize-sign-in-page?view=o365-worldwide configured following instructions]. e.g.&lt;br /&gt;
##* &#039;&#039;&#039;Authorization Endpoint&#039;&#039;&#039;: &amp;lt;nowiki&amp;gt;https://login.microsoftonline.com/sample.onmicrosoft.com/oauth2/authorize&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
##* &#039;&#039;&#039;Token Endpoint&#039;&#039;&#039;: &amp;lt;nowiki&amp;gt;https://login.microsoftonline.com/sample.onmicrosoft.com/oauth2/token&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
## Note the endpoints may be in different format for B2C tenants. Please verify it in your Azure AD portal.&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure portal later, so note this value and put it aside.&lt;br /&gt;
#* For example, https://www.example.com/auth/oidc/&lt;br /&gt;
#* Notes:&lt;br /&gt;
#*# This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any reason, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
#*# This URI must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
#*# The Moodle site&#039;s configured URL must use HTTPS, even with a self signed SSL cert. Redirect URI using HTTP will not be acceptable when creating Azure app for the integration.&lt;br /&gt;
#*# If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
#*# This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
=== Prepare your Microsoft 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Microsoft 365 for SSO, you must configure Microsoft Azure to manage your Microsoft 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
#* If you followed steps above to create the Azure app, you should be redirected to the app settings page already.&lt;br /&gt;
#* Otherwise:&lt;br /&gt;
#*# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
#*# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
#*# Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
#*# Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
#*# Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;.&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;.&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this value (write it down or copy it somewhere) and set it aside. You&#039;ll need it later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &#039;&#039;&#039;Set&#039;&#039;&#039; link next to &#039;&#039;&#039;Application ID URI&#039;&#039;&#039;.&lt;br /&gt;
## This should open a &#039;&#039;&#039;Set the APP ID URI&#039;&#039;&#039; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://&#039;&#039;&#039;URL.TO.MOODLE&#039;&#039;&#039;/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &#039;&#039;&#039;Save&#039;&#039;&#039; to create the Application ID URI.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a scope&#039;&#039;&#039;.&lt;br /&gt;
## Enter &#039;&#039;&#039;access_as_user&#039;&#039;&#039; as scope name.&lt;br /&gt;
## Set &#039;&#039;&#039;Who can consent?&#039;&#039;&#039; to &#039;&#039;&#039;Admins and users&#039;&#039;&#039;.&lt;br /&gt;
## Set &#039;&#039;&#039;Admin consent title&#039;&#039;&#039; to &#039;&#039;&#039;Teams can access the user’s profile&#039;&#039;&#039;.&lt;br /&gt;
## Set &#039;&#039;&#039;Admin consent description&#039;&#039;&#039; to &#039;&#039;&#039;Allows Teams to call the app’s web APIs as the current user&#039;&#039;&#039;.&lt;br /&gt;
## Set &#039;&#039;&#039;User consent title&#039;&#039;&#039; to &#039;&#039;&#039;Teams can access the user profile and make requests on the user&#039;s behalf&#039;&#039;&#039;.&lt;br /&gt;
## Set &#039;&#039;&#039;User consent description&#039;&#039;&#039; to &#039;&#039;&#039;Enable Teams to call this app’s APIs with the same rights as the user&#039;&#039;&#039;.&lt;br /&gt;
## Ensure that &#039;&#039;&#039;State&#039;&#039;&#039; is set to be &#039;&#039;&#039;Enabled&#039;&#039;&#039;.&lt;br /&gt;
## Select the &#039;&#039;&#039;Add scope&#039;&#039;&#039; button to save.&lt;br /&gt;
## In the &#039;&#039;&#039;Authorized client applications&#039;&#039;&#039; section, identify the applications that you want to authorize for your app’s web application. Select &#039;&#039;&#039;Add a client application&#039;&#039;&#039;. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
##* &#039;&#039;&#039;&amp;lt;code&amp;gt;1fec8e78-bce4-4aaf-ab1b-5451cc387264&amp;lt;/code&amp;gt;&#039;&#039;&#039; (Teams mobile/desktop application)&lt;br /&gt;
##* &#039;&#039;&#039;&amp;lt;code&amp;gt;5e3ce6c0-2b1f-4285-8d4b-75ee78787346&amp;lt;/code&amp;gt;&#039;&#039;&#039; (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &#039;&#039;&#039;Microsoft Graph&#039;&#039;&#039;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &#039;&#039;&#039;Application&#039;&#039;&#039; and &#039;&#039;&#039;Delegated&#039;&#039;&#039; permissions sections according to the section below.&lt;br /&gt;
## After all the permissions are added, click the &#039;&#039;&#039;Grant admin consent for YOUR ORGANISATION NAME&#039;&#039;&#039; link.&lt;br /&gt;
## When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
===== Azure app permissions =====&lt;br /&gt;
The integration uses various [https://docs.microsoft.com/en-us/graph/overview Microsoft Graph APIs] to communicate with Microsoft 365 to get and set data. Each Graph API would require a different set of app permissions. The integration provides a list of recommended permissions to be given to ensure all features in the integration works, all of which are added automatically by the PowerShell script if it&#039;s used. Advanced users can customise the permissions according to the need of their own organisation, e.g. if group/team integration is not used, all permissions related to group can be removed, e.g. Group.ReadWrite.All.&lt;br /&gt;
====== Application permissions vs delegated permissions ======&lt;br /&gt;
In general, if the Moodle site uses the &#039;&#039;&#039;Application access&#039;&#039;&#039; connection method, giving only application permissions would be enough; if the Moodle site uses the &#039;&#039;&#039;System API user&#039;&#039;&#039; connection method, only delegated permission are required.&lt;br /&gt;
&lt;br /&gt;
Note the following exception:&lt;br /&gt;
* &#039;&#039;&#039;User.Read&#039;&#039;&#039; delegated permission is always required regardless of connection method.&lt;br /&gt;
* If teams integration feature is used, the following delegated permissions are required for teams SSO to work, regardless of connection method:&lt;br /&gt;
** &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
* As of release 3.9.6 and 3.10.3 release of the plugins in June 2021, there are a small number of Microsoft Graph APIs used in the integration making calls to the &amp;quot;/me/&amp;quot; path, which would require the corresponding delegated permissions regardless of connection method. A plan is in place to replace calls like this in the next release, so that these delegated permissions can be removed. The delegated permissions affected are:&lt;br /&gt;
** &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039; for calendar sync.&lt;br /&gt;
** &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039; and &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039; for OneDrive integration.&lt;br /&gt;
** &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039; for OneNote integration.&lt;br /&gt;
====== Permissions ======&lt;br /&gt;
For a full list of Microsoft Graph API used, and the permissions required, please refer to [https://docs.google.com/spreadsheets/d/1XIFnnQ8RuFjlPGB8CiiMmK8x9Uta9XIR_icvAdx0G6k this spreadsheet]. Note that:&lt;br /&gt;
* This document is constantly updated.&lt;br /&gt;
* For each Graph API, a few permissions may be listed. Graph API can be called if permissions in any line is added, and the admin consent is granted for your organisation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The recommended permissions to ensure all integration features work are listed below. These would be the same set of permissions that are applied when using the PowerShell script to set up the Azure app.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;10&amp;quot; | Application Permissions&lt;br /&gt;
|&#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| A common permission used in both user syncs and group integration.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| A common permission used in both user syncs and group integration.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group/team integration.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;User.Read.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required for SSO and to sync user information between Microsoft 365 and Moodle.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Microsoft 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
|Required to detect OneDrive for Business URL setting.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;AppRoleAssignment.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Manage app permission grants and app role assignments&#039;&#039;&#039;&lt;br /&gt;
| Required for assigning users to application during user sync if the option is enabled. &lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;16&amp;quot; |Delegated Permissions&lt;br /&gt;
|&#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| A common permission used in both user syncs and group integration.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| A common permission used in both user syncs and group integration.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;User.Read.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
|Required for SSO and to sync user information between Microsoft 365 and Moodle.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Have full access to all files user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the Microsoft 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;AppRoleAssignment.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Manage app permission grants and app role assignments&#039;&#039;&#039;&lt;br /&gt;
|Required for assigning users to application during user sync if the option is enabled. &lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Read user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Microsoft 365, and to access Microsoft 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
=== Configure the Microsoft 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Microsoft 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Microsoft 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Microsoft 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
== Connecting users to Microsoft 365 ==&lt;br /&gt;
To use any Microsoft 365 features, a Moodle user must be connected to a Microsoft 365 user that has an active Microsoft 365 subscription. There are two ways to connect a Moodle user to a Microsoft 365 user.&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Microsoft 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
=== Link a Moodle user to a Microsoft 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Microsoft 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Microsoft 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Microsoft 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Microsoft 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Microsoft 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Microsoft 365 user.&lt;br /&gt;
= Microsoft 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Microsoft 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Microsoft 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Microsoft 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Microsoft 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Microsoft 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Microsoft 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Microsoft 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Microsoft 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced.&lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to a Microsoft 365 group, enabling all group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Microsoft 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Microsoft 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Microsoft 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to a Microsoft 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Microsoft 365 user, only a group will be created.&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Microsoft 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Microsoft 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Microsoft 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Microsoft 365 accounts. Each user in the system is listed alongside the Microsoft 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Microsoft 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Microsoft 365 username, and a 1 or 0 indicating whether to enable Microsoft 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
**&#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Microsoft 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Microsoft 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;: This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Microsoft 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Microsoft 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 for China&#039;&#039;&#039;: Microsoft 365 in China differs slightly in some technical aspects. If you are using Microsoft 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Microsoft 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Microsoft 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Microsoft 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Microsoft 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Microsoft 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Microsoft 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Microsoft 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Microsoft 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Microsoft 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Microsoft 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
== Switching existing Moodle users to use Microsoft 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Microsoft 365.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Microsoft 365 Login&#039;&#039; link under &#039;&#039;&#039;Microsoft 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Microsoft 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Microsoft 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Microsoft 365, you will not have to enter your credentials on the Microsoft 365 login page. This Microsoft 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Microsoft 365 first to show the Microsoft 365 login screen.&lt;br /&gt;
# The Moodle account will now use Microsoft 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Microsoft 365 features in Moodle.&lt;br /&gt;
== Connecting existing Moodle users to Microsoft 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Microsoft 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Microsoft 365, you will not have to enter your credentials on the Microsoft 365 login page. This Microsoft 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Microsoft 365 first to show the Microsoft 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Microsoft 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Microsoft 365 account and can use Microsoft 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Microsoft 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
# Start as a user connected to Microsoft 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Microsoft 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Microsoft 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Microsoft 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
= Notes on special release =&lt;br /&gt;
== 3.8.0.4 and 3.9.1 release==&lt;br /&gt;
3.8.0.4 and 3.9.1 release of the plugins on 29 September 2020 introduced improvements on SSO integration for Moodle in Teams as well as Single Sign Off support, but requires additional actions from Moodle and Azure admins.&lt;br /&gt;
=== Moodle and Teams SSO integration ===&lt;br /&gt;
The new releases is capable of getting a user token from either Teams desktop/mobile app or Teams web app, and attempt to log in as the user in the Moodle Teams tab. In order for it to work, changes in 3 sections are required.&lt;br /&gt;
==== Update Azure app settings ====&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Microsoft 365 integration, and click its name.&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039;, select &#039;&#039;&#039;Expose an API&#039;&#039;&#039;.&lt;br /&gt;
# Select the &amp;quot;Set&amp;quot; link to generate the Application ID URI in the form of api://{AppID}. Insert your fully qualified domain name (with a forward slash &amp;quot;/&amp;quot; appended to the end) between the double forward slashes and the GUID. The entire ID should have the form of: api://fully-qualified-domain-name.com/{AppID}. e.g. api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000.&lt;br /&gt;
# If you get errors when selecting the &amp;quot;Set&amp;quot; link, it may be because the &#039;&#039;&#039;Supported account types&#039;&#039;&#039; setting of your app is set to a value rather than the one with &amp;quot;single tenant&amp;quot;. Try updating this value to get it working.&lt;br /&gt;
# Select the &amp;quot;Add a scope&amp;quot; button. In the panel that opens:&lt;br /&gt;
## enter &amp;quot;access_as_user&amp;quot; as the &amp;quot;Scope name&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to be &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to be &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to be &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to be &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;.&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
# In the Authorized client applications section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
## 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
## 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;API permissions&#039;&#039;&#039;, ensure the following permissions are added under &amp;quot;Microsoft Graph&amp;quot; &amp;gt; &amp;quot;Delegated permissions&amp;quot;:&lt;br /&gt;
## User.Read (enabled by default)&lt;br /&gt;
## email&lt;br /&gt;
## offline_access&lt;br /&gt;
## OpenId&lt;br /&gt;
## profile&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;Authentication&#039;&#039;&#039;, ensure the following boxes are checked for &amp;quot;implicit grant&amp;quot;:&lt;br /&gt;
## ID Token&lt;br /&gt;
## Access Token.&lt;br /&gt;
==== Download updated manifest file ====&lt;br /&gt;
# Login to Moodle as site administrator.&lt;br /&gt;
# Go to &amp;quot;Microsoft 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Teams Settings&amp;quot; tab.&lt;br /&gt;
# Verify settings on the page, note that two new settings are added in this release:&lt;br /&gt;
## &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039;: This is used in the &amp;quot;ID&amp;quot; field of [https://docs.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema Teams app manifest file], which is essentially a self generated app ID to identify itself. It should be set to the default value in most use cases, otherwise it may affect upgrading of the Teams app. The only scenario a custom value is to be set for this setting is when there are multiple Moodle sites in the organisation, and they all need to be integrated with Teams, thus each site will require a separate Teams app. If custom value is required, please use [https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7 powershell] or [https://www.guidgenerator.com/ external tools] to generate valid ones.&lt;br /&gt;
## &#039;&#039;&#039;Teams app name&#039;&#039;&#039;: This allows you to give a custom name, rather than the default &amp;quot;Moodle&amp;quot;, to the Moodle Teams app created. It can be useful if you have multiple Moodle sites in your organisation, and each creating a separate Moodle app for Teams integration.&lt;br /&gt;
# Once settings are verified, save changes, go back to the tab, and click the &amp;quot;Download manifest file&amp;quot; button to download the new manifest file for the upgraded app.&lt;br /&gt;
==== Update Moodle app in Teams ====&lt;br /&gt;
# As a tenant admin, go to Teams.&lt;br /&gt;
# Go to &amp;quot;Apps&amp;quot; page to manage apps.&lt;br /&gt;
# From the menu on the left, click on the link &amp;quot;Built for YOUR ORGANISATION&amp;quot;. This should list all custom apps uploaded for your tenant.&lt;br /&gt;
# Locate the previous Moodle app, click the options button on the card for more options, and click &amp;quot;update&amp;quot;. This should open a file picker.&lt;br /&gt;
# Select the new manifest file downloaded from Moodle.&lt;br /&gt;
Note that as long as the &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039; setting is not changed, this should be recognised as an app upgrade, rather than uploading a new app. This means that the app will be kept in all existing Teams that have it installed, and all existing Moodle tabs will keep working.&lt;br /&gt;
==== Known limitations ====&lt;br /&gt;
It is a known issue that if a Microsoft 365 user has never login to Moodle either, her first attempt to SSO from Teams to Moodle will not work silently. Instead, the user will need to click a button from the prompt to login.&lt;br /&gt;
=== Single Sign Off ===&lt;br /&gt;
When a Microsoft 365 authenticated user clicks the Moodle log out button, it is possible to log the user out from Microsoft 365 at the same time.&lt;br /&gt;
&lt;br /&gt;
In order for this to work, configuration changes in two places are required:&lt;br /&gt;
==== Moodle settings change ====&lt;br /&gt;
# Sign in Moodle as site admin.&lt;br /&gt;
# Go to &amp;quot;OpenID Connect&amp;quot; settings page under Plugins - Authentication:&lt;br /&gt;
# Go to &amp;quot;Advanced&amp;quot; tab.&lt;br /&gt;
# Enable &amp;quot;Single sign off&amp;quot;.&lt;br /&gt;
# Save changes.&lt;br /&gt;
==== Azure app settings change ====&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Microsoft 365 integration, and click its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the root URL of your Moodle site (wwwroot) as an entry.&lt;br /&gt;
== 3.8.0.5 and 3.9.2 release==&lt;br /&gt;
3.8.0.5 and 3.9.2 release of the plugins on 18 November 2020 added support for synching the default timezone preference of the user in Outlook to Moodle. This requires the following permission to be granted for the Azure app:&lt;br /&gt;
# &#039;&#039;&#039;Delegated permissions&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Application permissions&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Microsoft_365&amp;diff=138871</id>
		<title>Microsoft 365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Microsoft_365&amp;diff=138871"/>
		<updated>2021-04-21T11:11:17Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams https://moodle.org/plugins/assignsubmission_onenote https://moodle.org/plugins/assignfeedback_onenote&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Microsoft 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Microsoft 365 authentication and basic OneDrive repository support, the Microsoft 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Microsoft 365 plugin suite:&lt;br /&gt;
* User sync from Microsoft 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Microsoft 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Microsoft 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Microsoft 365 plugins, you need the following:&lt;br /&gt;
* A Microsoft 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Microsoft 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Microsoft 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Microsoft 365 integration back-end. It provides shared code to communicate with Microsoft 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Microsoft 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Microsoft 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Microsoft 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Microsoft 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Microsoft 365 for SSO, you must configure Microsoft Azure to manage your Microsoft 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need it later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;9&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Microsoft 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Microsoft 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Microsoft 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;16&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Microsoft 365, and to access Microsoft 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Microsoft 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Microsoft 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Microsoft 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Microsoft 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Microsoft 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Microsoft 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Microsoft 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Microsoft 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Microsoft 365 ==&lt;br /&gt;
To use any Microsoft 365 features, a Moodle user must be connected to a Microsoft 365 user that has an active Microsoft 365 subscription. There are two ways to connect a Moodle user to a Microsoft 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Microsoft 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to a Microsoft 365 user===&lt;br /&gt;
Users in Moodle can also be linked to Microsoft 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Microsoft 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Microsoft 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Microsoft 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Microsoft 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Microsoft 365 user.&lt;br /&gt;
&lt;br /&gt;
= Microsoft 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Microsoft 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Microsoft 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Microsoft 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Microsoft 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Microsoft 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Microsoft 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Microsoft 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Microsoft 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to a Microsoft 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Microsoft 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Microsoft 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Microsoft 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to a Microsoft 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Microsoft 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Microsoft 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Microsoft 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Microsoft 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Microsoft 365 accounts. Each user in the system is listed alongside the Microsoft 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Microsoft 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Microsoft 365 username, and a 1 or 0 indicating whether to enable Microsoft 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Microsoft 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Microsoft 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Microsoft 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Microsoft 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 for China&#039;&#039;&#039;: Microsoft 365 in China differs slightly in some technical aspects. If you are using Microsoft 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Microsoft 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Microsoft 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Microsoft 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Microsoft 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Microsoft 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Microsoft 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Microsoft 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Microsoft 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Microsoft 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Microsoft 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Microsoft 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Microsoft 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Microsoft 365 Login&#039;&#039; link under &#039;&#039;&#039;Microsoft 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Microsoft 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Microsoft 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Microsoft 365, you will not have to enter your credentials on the Microsoft 365 login page. This Microsoft 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Microsoft 365 first to show the Microsoft 365 login screen.&lt;br /&gt;
# The Moodle account will now use Microsoft 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Microsoft 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Microsoft 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Microsoft 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Microsoft 365, you will not have to enter your credentials on the Microsoft 365 login page. This Microsoft 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Microsoft 365 first to show the Microsoft 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Microsoft 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Microsoft 365 account and can use Microsoft 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Microsoft 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Microsoft 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Microsoft 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Microsoft 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Microsoft 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
= Notes on special release =&lt;br /&gt;
== 3.8.0.4 and 3.9.1 release==&lt;br /&gt;
3.8.0.4 and 3.9.1 release of the plugins on 29 September 2020 introduced improvements on SSO integration for Moodle in Teams as well as Single Sign Off support, but requires additional actions from Moodle and Azure admins.&lt;br /&gt;
&lt;br /&gt;
=== Moodle and Teams SSO integration ===&lt;br /&gt;
The new releases is capable of getting a user token from either Teams desktop/mobile app or Teams web app, and attempt to log in as the user in the Moodle Teams tab. In order for it to work, changes in 3 sections are required.&lt;br /&gt;
&lt;br /&gt;
==== Update Azure app settings ====&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Microsoft 365 integration, and click its name.&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039;, select &#039;&#039;&#039;Expose an API&#039;&#039;&#039;.&lt;br /&gt;
# Select the &amp;quot;Set&amp;quot; link to generate the Application ID URI in the form of api://{AppID}. Insert your fully qualified domain name (with a forward slash &amp;quot;/&amp;quot; appended to the end) between the double forward slashes and the GUID. The entire ID should have the form of: api://fully-qualified-domain-name.com/{AppID}. e.g. api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000.&lt;br /&gt;
# If you get errors when selecting the &amp;quot;Set&amp;quot; link, it may be because the &#039;&#039;&#039;Supported account types&#039;&#039;&#039; setting of your app is set to a value rather than the one with &amp;quot;single tenant&amp;quot;. Try updating this value to get it working.&lt;br /&gt;
# Select the &amp;quot;Add a scope&amp;quot; button. In the panel that opens:&lt;br /&gt;
## enter &amp;quot;access_as_user&amp;quot; as the &amp;quot;Scope name&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to be &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to be &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to be &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to be &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;.&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
# In the Authorized client applications section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
## 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
## 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;API permissions&#039;&#039;&#039;, ensure the following permissions are added under &amp;quot;Microsoft Graph&amp;quot; &amp;gt; &amp;quot;Delegated permissions&amp;quot;:&lt;br /&gt;
## User.Read (enabled by default)&lt;br /&gt;
## email&lt;br /&gt;
## offline_access&lt;br /&gt;
## OpenId&lt;br /&gt;
## profile&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;Authentication&#039;&#039;&#039;, ensure the following boxes are checked for &amp;quot;implicit grant&amp;quot;:&lt;br /&gt;
## ID Token&lt;br /&gt;
## Access Token.&lt;br /&gt;
&lt;br /&gt;
==== Download updated manifest file ====&lt;br /&gt;
# Login to Moodle as site administrator.&lt;br /&gt;
# Go to &amp;quot;Microsoft 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Teams Settings&amp;quot; tab.&lt;br /&gt;
# Verify settings on the page, note that two new settings are added in this release:&lt;br /&gt;
## &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039;: This is used in the &amp;quot;ID&amp;quot; field of [https://docs.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema Teams app manifest file], which is essentially a self generated app ID to identify itself. It should be set to the default value in most use cases, otherwise it may affect upgrading of the Teams app. The only scenario a custom value is to be set for this setting is when there are multiple Moodle sites in the organisation, and they all need to be integrated with Teams, thus each site will require a separate Teams app. If custom value is required, please use [https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7 powershell] or [https://www.guidgenerator.com/ external tools] to generate valid ones.&lt;br /&gt;
## &#039;&#039;&#039;Teams app name&#039;&#039;&#039;: This allows you to give a custom name, rather than the default &amp;quot;Moodle&amp;quot;, to the Moodle Teams app created. It can be useful if you have multiple Moodle sites in your organisation, and each creating a separate Moodle app for Teams integration.&lt;br /&gt;
# Once settings are verified, save changes, go back to the tab, and click the &amp;quot;Download manifest file&amp;quot; button to download the new manifest file for the upgraded app.&lt;br /&gt;
==== Update Moodle app in Teams ====&lt;br /&gt;
# As a tenant admin, go to Teams.&lt;br /&gt;
# Go to &amp;quot;Apps&amp;quot; page to manage apps.&lt;br /&gt;
# From the menu on the left, click on the link &amp;quot;Built for YOUR ORGANISATION&amp;quot;. This should list all custom apps uploaded for your tenant.&lt;br /&gt;
# Locate the previous Moodle app, click the options button on the card for more options, and click &amp;quot;update&amp;quot;. This should open a file picker.&lt;br /&gt;
# Select the new manifest file downloaded from Moodle.&lt;br /&gt;
Note that as long as the &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039; setting is not changed, this should be recognised as an app upgrade, rather than uploading a new app. This means that the app will be kept in all existing Teams that have it installed, and all existing Moodle tabs will keep working.&lt;br /&gt;
&lt;br /&gt;
==== Known limitations ====&lt;br /&gt;
It is a known issue that if a Microsoft 365 user has never login to Moodle either, her first attempt to SSO from Teams to Moodle will not work silently. Instead, the user will need to click a button from the prompt to login.&lt;br /&gt;
&lt;br /&gt;
=== Single Sign Off ===&lt;br /&gt;
When a Microsoft 365 authenticated user clicks the Moodle log out button, it is possible to log the user out from Microsoft 365 at the same time.&lt;br /&gt;
&lt;br /&gt;
In order for this to work, configuration changes in two places are required:&lt;br /&gt;
==== Moodle settings change ==== &lt;br /&gt;
# Sign in Moodle as site admin.&lt;br /&gt;
# Go to &amp;quot;OpenID Connect&amp;quot; settings page under Plugins - Authentication:&lt;br /&gt;
# Enable &amp;quot;Single sign off&amp;quot;.&lt;br /&gt;
# Save changes.&lt;br /&gt;
==== Azure app settings change ====&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Microsoft 365 integration, and click its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the root URL of your Moodle site (wwwroot) as an entry.&lt;br /&gt;
&lt;br /&gt;
== 3.8.0.5 and 3.9.2 release==&lt;br /&gt;
3.8.0.5 and 3.9.2 release of the plugins on 18 November 2020 added support for synching the default timezone preference of the user in Outlook to Moodle. This requires the following permission to be granted for the Azure app:&lt;br /&gt;
# &#039;&#039;&#039;Delegated permissions&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Application permissions&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Microsoft_365&amp;diff=138809</id>
		<title>Microsoft 365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Microsoft_365&amp;diff=138809"/>
		<updated>2021-02-01T11:01:17Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams https://moodle.org/plugins/assignsubmission_onenote https://moodle.org/plugins/assignfeedback_onenote&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Microsoft 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Microsoft 365 authentication and basic OneDrive repository support, the Microsoft 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Microsoft 365 plugin suite:&lt;br /&gt;
* User sync from Microsoft 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Microsoft 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Microsoft 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Microsoft 365 plugins, you need the following:&lt;br /&gt;
* A Microsoft 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Microsoft 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Microsoft 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Microsoft 365 integration back-end. It provides shared code to communicate with Microsoft 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Microsoft 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Microsoft 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Microsoft 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Microsoft 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Microsoft 365 for SSO, you must configure Microsoft Azure to manage your Microsoft 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need it later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;9&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Microsoft 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Microsoft 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Microsoft 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;16&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Microsoft 365, and to access Microsoft 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Microsoft 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Microsoft 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Microsoft 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Microsoft 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Microsoft 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Microsoft 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Microsoft 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Microsoft 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Microsoft 365 ==&lt;br /&gt;
To use any Microsoft 365 features, a Moodle user must be connected to a Microsoft 365 user that has an active Microsoft 365 subscription. There are two ways to connect a Moodle user to a Microsoft 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Microsoft 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to a Microsoft 365 user===&lt;br /&gt;
Users in Moodle can also be linked to Microsoft 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Microsoft 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Microsoft 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Microsoft 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Microsoft 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Microsoft 365 user.&lt;br /&gt;
&lt;br /&gt;
= Microsoft 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Microsoft 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Microsoft 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Microsoft 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Microsoft 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Microsoft 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Microsoft 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Microsoft 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Microsoft 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to a Microsoft 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Microsoft 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Microsoft 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Microsoft 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to a Microsoft 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Microsoft 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Microsoft 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Microsoft 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Microsoft 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Microsoft 365 accounts. Each user in the system is listed alongside the Microsoft 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Microsoft 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Microsoft 365 username, and a 1 or 0 indicating whether to enable Microsoft 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Microsoft 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Microsoft 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Microsoft 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Microsoft 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 for China&#039;&#039;&#039;: Microsoft 365 in China differs slightly in some technical aspects. If you are using Microsoft 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Microsoft 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Microsoft 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Microsoft 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Microsoft 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Microsoft 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Microsoft 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Microsoft 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Microsoft 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Microsoft 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Microsoft 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Microsoft 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Microsoft 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Microsoft 365 Login&#039;&#039; link under &#039;&#039;&#039;Microsoft 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Microsoft 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Microsoft 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Microsoft 365, you will not have to enter your credentials on the Microsoft 365 login page. This Microsoft 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Microsoft 365 first to show the Microsoft 365 login screen.&lt;br /&gt;
# The Moodle account will now use Microsoft 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Microsoft 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Microsoft 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Microsoft 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Microsoft 365, you will not have to enter your credentials on the Microsoft 365 login page. This Microsoft 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Microsoft 365 first to show the Microsoft 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Microsoft 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Microsoft 365 account and can use Microsoft 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Microsoft 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Microsoft 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Microsoft 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Microsoft 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Microsoft 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
= Notes on special release =&lt;br /&gt;
== 3.8.0.4 and 3.9.1 release==&lt;br /&gt;
3.8.0.4 and 3.9.1 release of the plugins on 29 September 2020 introduced improvements on SSO integration for Moodle in Teams as well as Single Sign Off support, but requires additional actions from Moodle and Azure admins.&lt;br /&gt;
&lt;br /&gt;
=== Moodle and Teams SSO integration ===&lt;br /&gt;
The new releases is capable of getting a user token from either Teams desktop/mobile app or Teams web app, and attempt to log in as the user in the Moodle Teams tab. In order for it to work, changes in 3 sections are required.&lt;br /&gt;
&lt;br /&gt;
==== Update Azure app settings ====&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Microsoft 365 integration, and click its name.&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039;, select &#039;&#039;&#039;Expose an API&#039;&#039;&#039;.&lt;br /&gt;
# Select the &amp;quot;Set&amp;quot; link to generate the Application ID URI in the form of api://{AppID}. Insert your fully qualified domain name (with a forward slash &amp;quot;/&amp;quot; appended to the end) between the double forward slashes and the GUID. The entire ID should have the form of: api://fully-qualified-domain-name.com/{AppID}. e.g. api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000.&lt;br /&gt;
# If you get errors when selecting the &amp;quot;Set&amp;quot; link, it may be because the &#039;&#039;&#039;Supported account types&#039;&#039;&#039; setting of your app is set to a value rather than the one with &amp;quot;single tenant&amp;quot;. Try updating this value to get it working.&lt;br /&gt;
# Select the &amp;quot;Add a scope&amp;quot; button. In the panel that opens:&lt;br /&gt;
## enter &amp;quot;access_as_user&amp;quot; as the &amp;quot;Scope name&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to be &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to be &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to be &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to be &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;.&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
# In the Authorized client applications section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
## 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
## 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;API permissions&#039;&#039;&#039;, ensure the following permissions are added under &amp;quot;Microsoft Graph&amp;quot; &amp;gt; &amp;quot;Delegated permissions&amp;quot;:&lt;br /&gt;
## User.Read (enabled by default)&lt;br /&gt;
## email&lt;br /&gt;
## offline_access&lt;br /&gt;
## OpenId&lt;br /&gt;
## profile&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;Authentication&#039;&#039;&#039;, ensure the following boxes are checked for &amp;quot;implicit grant&amp;quot;:&lt;br /&gt;
## ID Token&lt;br /&gt;
## Access Token.&lt;br /&gt;
&lt;br /&gt;
==== Download updated manifest file ====&lt;br /&gt;
# Login to Moodle as site administrator.&lt;br /&gt;
# Go to &amp;quot;Microsoft 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Teams Settings&amp;quot; tab.&lt;br /&gt;
# Verify settings on the page, note that two new settings are added in this release:&lt;br /&gt;
## &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039;: This is used in the &amp;quot;ID&amp;quot; field of [https://docs.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema Teams app manifest file], which is essentially a self generated app ID to identify itself. It should be set to the default value in most use cases, otherwise it may affect upgrading of the Teams app. The only scenario a custom value is to be set for this setting is when there are multiple Moodle sites in the organisation, and they all need to be integrated with Teams, thus each site will require a separate Teams app. If custom value is required, please use [https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7 powershell] or [https://www.guidgenerator.com/ external tools] to generate valid ones.&lt;br /&gt;
## &#039;&#039;&#039;Teams app name&#039;&#039;&#039;: This allows you to give a custom name, rather than the default &amp;quot;Moodle&amp;quot;, to the Moodle Teams app created. It can be useful if you have multiple Moodle sites in your organisation, and each creating a separate Moodle app for Teams integration.&lt;br /&gt;
# Once settings are verified, save changes, go back to the tab, and click the &amp;quot;Download manifest file&amp;quot; button to download the new manifest file for the upgraded app.&lt;br /&gt;
==== Update Moodle app in Teams ====&lt;br /&gt;
# As a tenant admin, go to Teams.&lt;br /&gt;
# Go to &amp;quot;Apps&amp;quot; page to manage apps.&lt;br /&gt;
# From the menu on the left, click on the link &amp;quot;Built for YOUR ORGANISATION&amp;quot;. This should list all custom apps uploaded for your tenant.&lt;br /&gt;
# Locate the previous Moodle app, click the options button on the card for more options, and click &amp;quot;update&amp;quot;. This should open a file picker.&lt;br /&gt;
# Select the new manifest file downloaded from Moodle.&lt;br /&gt;
Note that as long as the &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039; setting is not changed, this should be recognised as an app upgrade, rather than uploading a new app. This means that the app will be kept in all existing Teams that have it installed, and all existing Moodle tabs will keep working.&lt;br /&gt;
&lt;br /&gt;
==== Known limitations ====&lt;br /&gt;
It is a known issue that if a Microsoft 365 user has never login to Moodle either, her first attempt to SSO from Teams to Moodle will not work silently. Instead, the user will need to click a button from the prompt to login.&lt;br /&gt;
&lt;br /&gt;
=== Single Sign Off ===&lt;br /&gt;
When a Microsoft 365 authenticated user clicks the Moodle log out button, it is possible to log the user out from Microsoft 365 at the same time.&lt;br /&gt;
&lt;br /&gt;
In order for this to work, configuration changes in two places are required:&lt;br /&gt;
==== Moodle settings change ==== &lt;br /&gt;
# Sign in Moodle as site admin.&lt;br /&gt;
# Go to &amp;quot;Microsoft 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Advanced&amp;quot; tab.&lt;br /&gt;
# Enable &amp;quot;Single sign off&amp;quot;.&lt;br /&gt;
# Save changes.&lt;br /&gt;
==== Azure app settings change ====&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Microsoft 365 integration, and click its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the root URL of your Moodle site (wwwroot) as an entry.&lt;br /&gt;
&lt;br /&gt;
== 3.8.0.5 and 3.9.2 release==&lt;br /&gt;
3.8.0.5 and 3.9.2 release of the plugins on 18 November 2020 added support for synching the default timezone preference of the user in Outlook to Moodle. This requires the following permission to be granted for the Azure app:&lt;br /&gt;
# &#039;&#039;&#039;Delegated permissions&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Application permissions&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Microsoft365&amp;diff=138805</id>
		<title>Microsoft365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Microsoft365&amp;diff=138805"/>
		<updated>2021-01-29T17:00:06Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: Redirected page to Microsoft 365&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#redirect [[Microsoft_365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Microsoft_365&amp;diff=138804</id>
		<title>Microsoft 365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Microsoft_365&amp;diff=138804"/>
		<updated>2021-01-29T16:54:59Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams https://moodle.org/plugins/assignsubmission_onenote https://moodle.org/plugins/assignfeedback_onenote&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Microsoft 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Microsoft 365 authentication and basic OneDrive repository support, the Microsoft 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Microsoft 365 plugin suite:&lt;br /&gt;
* User sync from Microsoft 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Microsoft 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Microsoft 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Microsoft 365 plugins, you need the following:&lt;br /&gt;
* A Microsoft 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Microsoft 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Microsoft 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Microsoft 365 integration back-end. It provides shared code to communicate with Microsoft 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Microsoft 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Microsoft 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Microsoft 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Microsoft 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Microsoft 365 for SSO, you must configure Microsoft Azure to manage your Microsoft 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need it later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;9&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Microsoft 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Microsoft 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Microsoft 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;16&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Microsoft 365, and to access Microsoft 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Microsoft 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Microsoft 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Microsoft 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Microsoft 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Microsoft 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Microsoft 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Microsoft 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Microsoft 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Microsoft 365 ==&lt;br /&gt;
To use any Microsoft 365 features, a Moodle user must be connected to a Microsoft 365 user that has an active Microsoft 365 subscription. There are two ways to connect a Moodle user to a Microsoft 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Microsoft 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to a Microsoft 365 user===&lt;br /&gt;
Users in Moodle can also be linked to Microsoft 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Microsoft 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Microsoft 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Microsoft 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Microsoft 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Microsoft 365 user.&lt;br /&gt;
&lt;br /&gt;
= Microsoft 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Microsoft 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Microsoft 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Microsoft 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Microsoft 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Microsoft 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Microsoft 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Microsoft 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Microsoft 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to a Microsoft 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Microsoft 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Microsoft 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Microsoft 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to a Microsoft 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Microsoft 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Microsoft 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Microsoft 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Microsoft 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Microsoft 365 accounts. Each user in the system is listed alongside the Microsoft 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Microsoft 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Microsoft 365 username, and a 1 or 0 indicating whether to enable Microsoft 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Microsoft 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Microsoft 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Microsoft 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Microsoft 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 for China&#039;&#039;&#039;: Microsoft 365 in China differs slightly in some technical aspects. If you are using Microsoft 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Microsoft 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Microsoft 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Microsoft 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Microsoft 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Microsoft 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Microsoft 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Microsoft 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Microsoft 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Microsoft 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Microsoft 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Microsoft 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Microsoft 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Microsoft 365 Login&#039;&#039; link under &#039;&#039;&#039;Microsoft 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Microsoft 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Microsoft 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Microsoft 365, you will not have to enter your credentials on the Microsoft 365 login page. This Microsoft 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Microsoft 365 first to show the Microsoft 365 login screen.&lt;br /&gt;
# The Moodle account will now use Microsoft 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Microsoft 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Microsoft 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Microsoft 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Microsoft 365, you will not have to enter your credentials on the Microsoft 365 login page. This Microsoft 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Microsoft 365 first to show the Microsoft 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Microsoft 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Microsoft 365 account and can use Microsoft 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Microsoft 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Microsoft 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Microsoft 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Microsoft 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Microsoft 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
= Notes on special release =&lt;br /&gt;
== 3.8.0.4 and 3.9.1 release==&lt;br /&gt;
3.8.0.4 and 3.9.1 release of the plugins on 29 September 2020 introduced improvements on SSO integration for Moodle in Teams as well as Single Sign Off support, but requires additional actions from Moodle and Azure admins.&lt;br /&gt;
=== Moodle and Teams SSO integration ===&lt;br /&gt;
The new releases is capable of getting a user token from either Teams desktop/mobile app or Teams web app, and attempt to log in as the user in the Moodle Teams tab. In order for it to work, changes in 3 sections are required.&lt;br /&gt;
==== Download updated manifest file ====&lt;br /&gt;
# Login to Moodle as site administrator.&lt;br /&gt;
# Go to &amp;quot;Microsoft 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Teams Settings&amp;quot; tab.&lt;br /&gt;
# Verify settings on the page, note that two new settings are added in this release:&lt;br /&gt;
## &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039;: This is used in the &amp;quot;ID&amp;quot; field of [https://docs.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema Teams app manifest file], which is essentially a self generated app ID to identify itself. It should be set to the default value in most use cases, otherwise it may affect upgrading of the Teams app. The only scenario a custom value is to be set for this setting is when there are multiple Moodle sites in the organisation, and they all need to be integrated with Teams, thus each site will require a separate Teams app. If custom value is required, please use [https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7 powershell] or [https://www.guidgenerator.com/ external tools] to generate valid ones.&lt;br /&gt;
## &#039;&#039;&#039;Teams app name&#039;&#039;&#039;: This allows you to give a custom name, rather than the default &amp;quot;Moodle&amp;quot;, to the Moodle Teams app created. It can be useful if you have multiple Moodle sites in your organisation, and each creating a separate Moodle app for Teams integration.&lt;br /&gt;
# Once settings are verified, save changes, go back to the tab, and click the &amp;quot;Download manifest file&amp;quot; button to download the new manifest file for the upgraded app.&lt;br /&gt;
==== Update Moodle app in Teams ====&lt;br /&gt;
# As a tenant admin, go to Teams.&lt;br /&gt;
# Go to &amp;quot;Apps&amp;quot; page to manage apps.&lt;br /&gt;
# From the menu on the left, click on the link &amp;quot;Built for YOUR ORGANISATION&amp;quot;. This should list all custom apps uploaded for your tenant.&lt;br /&gt;
# Locate the previous Moodle app, click the options button on the card for more options, and click &amp;quot;update&amp;quot;. This should open a file picker.&lt;br /&gt;
# Select the new manifest file downloaded from Moodle.&lt;br /&gt;
Note that as long as the &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039; setting is not changed, this should be recognised as an app upgrade, rather than uploading a new app. This means that the app will be kept in all existing Teams that have it installed, and all existing Moodle tabs will keep working.&lt;br /&gt;
==== Update Azure app settings ====&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Microsoft 365 integration, and click its name.&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039;, select &#039;&#039;&#039;Expose an API&#039;&#039;&#039;.&lt;br /&gt;
# Select the &amp;quot;Set&amp;quot; link to generate the Application ID URI in the form of api://{AppID}. Insert your fully qualified domain name (with a forward slash &amp;quot;/&amp;quot; appended to the end) between the double forward slashes and the GUID. The entire ID should have the form of: api://fully-qualified-domain-name.com/{AppID}. e.g. api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000.&lt;br /&gt;
# If you get errors when selecting the &amp;quot;Set&amp;quot; link, it may be because the &#039;&#039;&#039;Supported account types&#039;&#039;&#039; setting of your app is set to a value rather than the one with &amp;quot;single tenant&amp;quot;. Try updating this value to get it working.&lt;br /&gt;
# Select the &amp;quot;Add a scope&amp;quot; button. In the panel that opens:&lt;br /&gt;
## enter &amp;quot;access_as_user&amp;quot; as the &amp;quot;Scope name&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to be &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to be &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to be &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to be &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;.&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
# In the Authorized client applications section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
## 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
## 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;API permissions&#039;&#039;&#039;, ensure the following permissions are added under &amp;quot;Microsoft Graph&amp;quot; &amp;gt; &amp;quot;Delegated permissions&amp;quot;:&lt;br /&gt;
## User.Read (enabled by default)&lt;br /&gt;
## email&lt;br /&gt;
## offline_access&lt;br /&gt;
## OpenId&lt;br /&gt;
## profile&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;Authentication&#039;&#039;&#039;, ensure the following boxes are checked for &amp;quot;implicit grant&amp;quot;:&lt;br /&gt;
## ID Token&lt;br /&gt;
## Access Token.&lt;br /&gt;
&lt;br /&gt;
==== Known limitations ====&lt;br /&gt;
It is a known issue that if an Microsoft 365 user has never login to Moodle either, her first attempt to SSO from Teams to Moodle will not work silently. Instead, the user will need to click a button from the prompt to login.&lt;br /&gt;
&lt;br /&gt;
=== Single Sign Off ===&lt;br /&gt;
When a Microsoft 365 authenticated user clicks the Moodle log out button, it is possible to log the user out from Microsoft 365 at the same time.&lt;br /&gt;
&lt;br /&gt;
In order for this to work, configuration changes in two places are required:&lt;br /&gt;
==== Moodle settings change ==== &lt;br /&gt;
# Sign in Moodle as site admin.&lt;br /&gt;
# Go to &amp;quot;Microsoft 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Advanced&amp;quot; tab.&lt;br /&gt;
# Enable &amp;quot;Single sign off&amp;quot;.&lt;br /&gt;
# Save changes.&lt;br /&gt;
==== Azure app settings change ====&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Microsoft 365 integration, and click its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the root URL of your Moodle site (wwwroot) as an entry.&lt;br /&gt;
&lt;br /&gt;
== 3.8.0.5 and 3.9.2 release==&lt;br /&gt;
3.8.0.5 and 3.9.2 release of the plugins on 18 November 2020 added support for synching the default timezone preference of the user in Outlook to Moodle. This requires the following permission to be granted for the Azure app:&lt;br /&gt;
# &#039;&#039;&#039;Delegated permissions&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Application permissions&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138803</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138803"/>
		<updated>2021-01-29T16:52:07Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: Redirected page to Microsoft 365&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#redirect [[Microsoft_365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Microsoft_365&amp;diff=138802</id>
		<title>Microsoft 365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Microsoft_365&amp;diff=138802"/>
		<updated>2021-01-29T16:51:11Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: Created page with &amp;quot;{{Infobox plugin |type = set |set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 |entry =  https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o3...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Microsoft 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Microsoft 365 authentication and basic OneDrive repository support, the Microsoft 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Microsoft 365 plugin suite:&lt;br /&gt;
* User sync from Microsoft 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Microsoft 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Microsoft 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Microsoft 365 plugins, you need the following:&lt;br /&gt;
* A Microsoft 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Microsoft 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Microsoft 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Microsoft 365 integration back-end. It provides shared code to communicate with Microsoft 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Microsoft 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Microsoft 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Microsoft 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Microsoft 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Microsoft 365 for SSO, you must configure Microsoft Azure to manage your Microsoft 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need it later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;9&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Microsoft 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Microsoft 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Microsoft 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;16&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Microsoft 365, and to access Microsoft 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Microsoft 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Microsoft 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Microsoft 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Microsoft 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Microsoft 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Microsoft 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Microsoft 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Microsoft 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Microsoft 365 ==&lt;br /&gt;
To use any Microsoft 365 features, a Moodle user must be connected to a Microsoft 365 user that has an active Microsoft 365 subscription. There are two ways to connect a Moodle user to a Microsoft 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Microsoft 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to a Microsoft 365 user===&lt;br /&gt;
Users in Moodle can also be linked to Microsoft 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Microsoft 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Microsoft 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Microsoft 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Microsoft 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Microsoft 365 user.&lt;br /&gt;
&lt;br /&gt;
= Microsoft 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Microsoft 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Microsoft 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Microsoft 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Microsoft 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Microsoft 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Microsoft 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Microsoft 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Microsoft 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to a Microsoft 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Microsoft 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Microsoft 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Microsoft 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to a Microsoft 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Microsoft 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Microsoft 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Microsoft 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Microsoft 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Microsoft 365 accounts. Each user in the system is listed alongside the Microsoft 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Microsoft 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Microsoft 365 username, and a 1 or 0 indicating whether to enable Microsoft 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Microsoft 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Microsoft 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Microsoft 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Microsoft 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 for China&#039;&#039;&#039;: Microsoft 365 in China differs slightly in some technical aspects. If you are using Microsoft 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Microsoft 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Microsoft 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Microsoft 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Microsoft 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Microsoft 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Microsoft 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Microsoft 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Microsoft 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Microsoft 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Microsoft 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Microsoft 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Microsoft 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Microsoft 365 Login&#039;&#039; link under &#039;&#039;&#039;Microsoft 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Microsoft 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Microsoft 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Microsoft 365, you will not have to enter your credentials on the Microsoft 365 login page. This Microsoft 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Microsoft 365 first to show the Microsoft 365 login screen.&lt;br /&gt;
# The Moodle account will now use Microsoft 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Microsoft 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Microsoft 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Microsoft 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Microsoft 365, you will not have to enter your credentials on the Microsoft 365 login page. This Microsoft 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Microsoft 365 first to show the Microsoft 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Microsoft 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Microsoft 365 account and can use Microsoft 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Microsoft 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Microsoft 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Microsoft 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Microsoft 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Microsoft 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
= Notes on special release =&lt;br /&gt;
== 3.8.0.4 and 3.9.1 release==&lt;br /&gt;
3.8.0.4 and 3.9.1 release of the plugins on 29 September 2020 introduced improvements on SSO integration for Moodle in Teams as well as Single Sign Off support, but requires additional actions from Moodle and Azure admins.&lt;br /&gt;
=== Moodle and Teams SSO integration ===&lt;br /&gt;
The new releases is capable of getting a user token from either Teams desktop/mobile app or Teams web app, and attempt to log in as the user in the Moodle Teams tab. In order for it to work, changes in 3 sections are required.&lt;br /&gt;
==== Download updated manifest file ====&lt;br /&gt;
# Login to Moodle as site administrator.&lt;br /&gt;
# Go to &amp;quot;Microsoft 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Teams Settings&amp;quot; tab.&lt;br /&gt;
# Verify settings on the page, note that two new settings are added in this release:&lt;br /&gt;
## &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039;: This is used in the &amp;quot;ID&amp;quot; field of [https://docs.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema Teams app manifest file], which is essentially a self generated app ID to identify itself. It should be set to the default value in most use cases, otherwise it may affect upgrading of the Teams app. The only scenario a custom value is to be set for this setting is when there are multiple Moodle sites in the organisation, and they all need to be integrated with Teams, thus each site will require a separate Teams app. If custom value is required, please use [https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7 powershell] or [https://www.guidgenerator.com/ external tools] to generate valid ones.&lt;br /&gt;
## &#039;&#039;&#039;Teams app name&#039;&#039;&#039;: This allows you to give a custom name, rather than the default &amp;quot;Moodle&amp;quot;, to the Moodle Teams app created. It can be useful if you have multiple Moodle sites in your organisation, and each creating a separate Moodle app for Teams integration.&lt;br /&gt;
# Once settings are verified, save changes, go back to the tab, and click the &amp;quot;Download manifest file&amp;quot; button to download the new manifest file for the upgraded app.&lt;br /&gt;
==== Update Moodle app in Teams ====&lt;br /&gt;
# As a tenant admin, go to Teams.&lt;br /&gt;
# Go to &amp;quot;Apps&amp;quot; page to manage apps.&lt;br /&gt;
# From the menu on the left, click on the link &amp;quot;Built for YOUR ORGANISATION&amp;quot;. This should list all custom apps uploaded for your tenant.&lt;br /&gt;
# Locate the previous Moodle app, click the options button on the card for more options, and click &amp;quot;update&amp;quot;. This should open a file picker.&lt;br /&gt;
# Select the new manifest file downloaded from Moodle.&lt;br /&gt;
Note that as long as the &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039; setting is not changed, this should be recognised as an app upgrade, rather than uploading a new app. This means that the app will be kept in all existing Teams that have it installed, and all existing Moodle tabs will keep working.&lt;br /&gt;
==== Update Azure app settings ====&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Microsoft 365 integration, and click its name.&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039;, select &#039;&#039;&#039;Expose an API&#039;&#039;&#039;.&lt;br /&gt;
# Select the &amp;quot;Set&amp;quot; link to generate the Application ID URI in the form of api://{AppID}. Insert your fully qualified domain name (with a forward slash &amp;quot;/&amp;quot; appended to the end) between the double forward slashes and the GUID. The entire ID should have the form of: api://fully-qualified-domain-name.com/{AppID}. e.g. api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000.&lt;br /&gt;
# If you get errors when selecting the &amp;quot;Set&amp;quot; link, it may be because the &#039;&#039;&#039;Supported account types&#039;&#039;&#039; setting of your app is set to a value rather than the one with &amp;quot;single tenant&amp;quot;. Try updating this value to get it working.&lt;br /&gt;
# Select the &amp;quot;Add a scope&amp;quot; button. In the panel that opens:&lt;br /&gt;
## enter &amp;quot;access_as_user&amp;quot; as the &amp;quot;Scope name&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to be &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to be &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to be &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to be &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;.&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
# In the Authorized client applications section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
## 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
## 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;API permissions&#039;&#039;&#039;, ensure the following permissions are added under &amp;quot;Microsoft Graph&amp;quot; &amp;gt; &amp;quot;Delegated permissions&amp;quot;:&lt;br /&gt;
## User.Read (enabled by default)&lt;br /&gt;
## email&lt;br /&gt;
## offline_access&lt;br /&gt;
## OpenId&lt;br /&gt;
## profile&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;Authentication&#039;&#039;&#039;, ensure the following boxes are checked for &amp;quot;implicit grant&amp;quot;:&lt;br /&gt;
## ID Token&lt;br /&gt;
## Access Token.&lt;br /&gt;
&lt;br /&gt;
==== Known limitations ====&lt;br /&gt;
It is a known issue that if an Microsoft 365 user has never login to Moodle either, her first attempt to SSO from Teams to Moodle will not work silently. Instead, the user will need to click a button from the prompt to login.&lt;br /&gt;
&lt;br /&gt;
=== Single Sign Off ===&lt;br /&gt;
When a Microsoft 365 authenticated user clicks the Moodle log out button, it is possible to log the user out from Microsoft 365 at the same time.&lt;br /&gt;
&lt;br /&gt;
In order for this to work, configuration changes in two places are required:&lt;br /&gt;
==== Moodle settings change ==== &lt;br /&gt;
# Sign in Moodle as site admin.&lt;br /&gt;
# Go to &amp;quot;Microsoft 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Advanced&amp;quot; tab.&lt;br /&gt;
# Enable &amp;quot;Single sign off&amp;quot;.&lt;br /&gt;
# Save changes.&lt;br /&gt;
==== Azure app settings change ====&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Microsoft 365 integration, and click its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the root URL of your Moodle site (wwwroot) as an entry.&lt;br /&gt;
&lt;br /&gt;
== 3.8.0.5 and 3.9.2 release==&lt;br /&gt;
3.8.0.5 and 3.9.2 release of the plugins on 18 November 2020 added support for synching the default timezone preference of the user in Outlook to Moodle. This requires the following permission to be granted for the Azure app:&lt;br /&gt;
# &#039;&#039;&#039;Delegated permissions&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Application permissions&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138801</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138801"/>
		<updated>2021-01-29T16:50:39Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Microsoft 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Microsoft 365 authentication and basic OneDrive repository support, the Microsoft 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Microsoft 365 plugin suite:&lt;br /&gt;
* User sync from Microsoft 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Microsoft 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Microsoft 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Microsoft 365 plugins, you need the following:&lt;br /&gt;
* A Microsoft 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Microsoft 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Microsoft 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Microsoft 365 integration back-end. It provides shared code to communicate with Microsoft 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Microsoft 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Microsoft 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Microsoft 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Microsoft 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Microsoft 365 for SSO, you must configure Microsoft Azure to manage your Microsoft 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need it later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;9&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Microsoft 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Microsoft 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Microsoft 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;16&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Microsoft 365, and to access Microsoft 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Microsoft 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Microsoft 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Microsoft 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Microsoft 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Microsoft 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Microsoft 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Microsoft 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Microsoft 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Microsoft 365 ==&lt;br /&gt;
To use any Microsoft 365 features, a Moodle user must be connected to a Microsoft 365 user that has an active Microsoft 365 subscription. There are two ways to connect a Moodle user to a Microsoft 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Microsoft 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to a Microsoft 365 user===&lt;br /&gt;
Users in Moodle can also be linked to Microsoft 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Microsoft 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Microsoft 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Microsoft 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Microsoft 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Microsoft 365 user.&lt;br /&gt;
&lt;br /&gt;
= Microsoft 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Microsoft 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Microsoft 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Microsoft 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Microsoft 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Microsoft 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Microsoft 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Microsoft 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Microsoft 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to a Microsoft 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Microsoft 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Microsoft 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Microsoft 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to a Microsoft 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Microsoft 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Microsoft 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Microsoft 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Microsoft 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Microsoft 365 accounts. Each user in the system is listed alongside the Microsoft 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Microsoft 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Microsoft 365 username, and a 1 or 0 indicating whether to enable Microsoft 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Microsoft 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Microsoft 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Microsoft 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Microsoft 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft 365 for China&#039;&#039;&#039;: Microsoft 365 in China differs slightly in some technical aspects. If you are using Microsoft 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Microsoft 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Microsoft 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Microsoft 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Microsoft 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Microsoft 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Microsoft 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Microsoft 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Microsoft 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Microsoft 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Microsoft 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Microsoft 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Microsoft 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Microsoft 365 Login&#039;&#039; link under &#039;&#039;&#039;Microsoft 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Microsoft 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Microsoft 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Microsoft 365, you will not have to enter your credentials on the Microsoft 365 login page. This Microsoft 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Microsoft 365 first to show the Microsoft 365 login screen.&lt;br /&gt;
# The Moodle account will now use Microsoft 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Microsoft 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Microsoft 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Microsoft 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Microsoft 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Microsoft 365, you will not have to enter your credentials on the Microsoft 365 login page. This Microsoft 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Microsoft 365 first to show the Microsoft 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Microsoft 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Microsoft 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Microsoft 365 account and can use Microsoft 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Microsoft 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Microsoft 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Microsoft 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Microsoft 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Microsoft 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
= Notes on special release =&lt;br /&gt;
== 3.8.0.4 and 3.9.1 release==&lt;br /&gt;
3.8.0.4 and 3.9.1 release of the plugins on 29 September 2020 introduced improvements on SSO integration for Moodle in Teams as well as Single Sign Off support, but requires additional actions from Moodle and Azure admins.&lt;br /&gt;
=== Moodle and Teams SSO integration ===&lt;br /&gt;
The new releases is capable of getting a user token from either Teams desktop/mobile app or Teams web app, and attempt to log in as the user in the Moodle Teams tab. In order for it to work, changes in 3 sections are required.&lt;br /&gt;
==== Download updated manifest file ====&lt;br /&gt;
# Login to Moodle as site administrator.&lt;br /&gt;
# Go to &amp;quot;Microsoft 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Teams Settings&amp;quot; tab.&lt;br /&gt;
# Verify settings on the page, note that two new settings are added in this release:&lt;br /&gt;
## &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039;: This is used in the &amp;quot;ID&amp;quot; field of [https://docs.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema Teams app manifest file], which is essentially a self generated app ID to identify itself. It should be set to the default value in most use cases, otherwise it may affect upgrading of the Teams app. The only scenario a custom value is to be set for this setting is when there are multiple Moodle sites in the organisation, and they all need to be integrated with Teams, thus each site will require a separate Teams app. If custom value is required, please use [https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7 powershell] or [https://www.guidgenerator.com/ external tools] to generate valid ones.&lt;br /&gt;
## &#039;&#039;&#039;Teams app name&#039;&#039;&#039;: This allows you to give a custom name, rather than the default &amp;quot;Moodle&amp;quot;, to the Moodle Teams app created. It can be useful if you have multiple Moodle sites in your organisation, and each creating a separate Moodle app for Teams integration.&lt;br /&gt;
# Once settings are verified, save changes, go back to the tab, and click the &amp;quot;Download manifest file&amp;quot; button to download the new manifest file for the upgraded app.&lt;br /&gt;
==== Update Moodle app in Teams ====&lt;br /&gt;
# As a tenant admin, go to Teams.&lt;br /&gt;
# Go to &amp;quot;Apps&amp;quot; page to manage apps.&lt;br /&gt;
# From the menu on the left, click on the link &amp;quot;Built for YOUR ORGANISATION&amp;quot;. This should list all custom apps uploaded for your tenant.&lt;br /&gt;
# Locate the previous Moodle app, click the options button on the card for more options, and click &amp;quot;update&amp;quot;. This should open a file picker.&lt;br /&gt;
# Select the new manifest file downloaded from Moodle.&lt;br /&gt;
Note that as long as the &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039; setting is not changed, this should be recognised as an app upgrade, rather than uploading a new app. This means that the app will be kept in all existing Teams that have it installed, and all existing Moodle tabs will keep working.&lt;br /&gt;
==== Update Azure app settings ====&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Microsoft 365 integration, and click its name.&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039;, select &#039;&#039;&#039;Expose an API&#039;&#039;&#039;.&lt;br /&gt;
# Select the &amp;quot;Set&amp;quot; link to generate the Application ID URI in the form of api://{AppID}. Insert your fully qualified domain name (with a forward slash &amp;quot;/&amp;quot; appended to the end) between the double forward slashes and the GUID. The entire ID should have the form of: api://fully-qualified-domain-name.com/{AppID}. e.g. api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000.&lt;br /&gt;
# If you get errors when selecting the &amp;quot;Set&amp;quot; link, it may be because the &#039;&#039;&#039;Supported account types&#039;&#039;&#039; setting of your app is set to a value rather than the one with &amp;quot;single tenant&amp;quot;. Try updating this value to get it working.&lt;br /&gt;
# Select the &amp;quot;Add a scope&amp;quot; button. In the panel that opens:&lt;br /&gt;
## enter &amp;quot;access_as_user&amp;quot; as the &amp;quot;Scope name&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to be &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to be &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to be &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to be &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;.&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
# In the Authorized client applications section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
## 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
## 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;API permissions&#039;&#039;&#039;, ensure the following permissions are added under &amp;quot;Microsoft Graph&amp;quot; &amp;gt; &amp;quot;Delegated permissions&amp;quot;:&lt;br /&gt;
## User.Read (enabled by default)&lt;br /&gt;
## email&lt;br /&gt;
## offline_access&lt;br /&gt;
## OpenId&lt;br /&gt;
## profile&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;Authentication&#039;&#039;&#039;, ensure the following boxes are checked for &amp;quot;implicit grant&amp;quot;:&lt;br /&gt;
## ID Token&lt;br /&gt;
## Access Token.&lt;br /&gt;
&lt;br /&gt;
==== Known limitations ====&lt;br /&gt;
It is a known issue that if an Microsoft 365 user has never login to Moodle either, her first attempt to SSO from Teams to Moodle will not work silently. Instead, the user will need to click a button from the prompt to login.&lt;br /&gt;
&lt;br /&gt;
=== Single Sign Off ===&lt;br /&gt;
When a Microsoft 365 authenticated user clicks the Moodle log out button, it is possible to log the user out from Microsoft 365 at the same time.&lt;br /&gt;
&lt;br /&gt;
In order for this to work, configuration changes in two places are required:&lt;br /&gt;
==== Moodle settings change ==== &lt;br /&gt;
# Sign in Moodle as site admin.&lt;br /&gt;
# Go to &amp;quot;Microsoft 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Advanced&amp;quot; tab.&lt;br /&gt;
# Enable &amp;quot;Single sign off&amp;quot;.&lt;br /&gt;
# Save changes.&lt;br /&gt;
==== Azure app settings change ====&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Microsoft 365 integration, and click its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the root URL of your Moodle site (wwwroot) as an entry.&lt;br /&gt;
&lt;br /&gt;
== 3.8.0.5 and 3.9.2 release==&lt;br /&gt;
3.8.0.5 and 3.9.2 release of the plugins on 18 November 2020 added support for synching the default timezone preference of the user in Outlook to Moodle. This requires the following permission to be granted for the Azure app:&lt;br /&gt;
# &#039;&#039;&#039;Delegated permissions&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Application permissions&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138757</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138757"/>
		<updated>2020-11-18T15:08:37Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* 3.8.0.4 and 3.9.1 release */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need it later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;9&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;16&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Office 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Office 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Office 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 for China&#039;&#039;&#039;: Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Office 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
= Notes on special release =&lt;br /&gt;
== 3.8.0.4 and 3.9.1 release==&lt;br /&gt;
3.8.0.4 and 3.9.1 release of the plugins on 29 September 2020 introduced improvements on SSO integration for Moodle in Teams as well as Single Sign Off support, but requires additional actions from Moodle and Azure admins.&lt;br /&gt;
=== Moodle and Teams SSO integration ===&lt;br /&gt;
The new releases is capable of getting a user token from either Teams desktop/mobile app or Teams web app, and attempt to log in as the user in the Moodle Teams tab. In order for it to work, changes in 3 sections are required.&lt;br /&gt;
==== Download updated manifest file ====&lt;br /&gt;
# Login to Moodle as site administrator.&lt;br /&gt;
# Go to &amp;quot;Microsoft Office 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Teams Settings&amp;quot; tab.&lt;br /&gt;
# Verify settings on the page, note that two new settings are added in this release:&lt;br /&gt;
## &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039;: This is used in the &amp;quot;ID&amp;quot; field of [https://docs.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema Teams app manifest file], which is essentially a self generated app ID to identify itself. It should be set to the default value in most use cases, otherwise it may affect upgrading of the Teams app. The only scenario a custom value is to be set for this setting is when there are multiple Moodle sites in the organisation, and they all need to be integrated with Teams, thus each site will require a separate Teams app. If custom value is required, please use [https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7 powershell] or [https://www.guidgenerator.com/ external tools] to generate valid ones.&lt;br /&gt;
## &#039;&#039;&#039;Teams app name&#039;&#039;&#039;: This allows you to give a custom name, rather than the default &amp;quot;Moodle&amp;quot;, to the Moodle Teams app created. It can be useful if you have multiple Moodle sites in your organisation, and each creating a separate Moodle app for Teams integration.&lt;br /&gt;
# Once settings are verified, save changes, go back to the tab, and click the &amp;quot;Download manifest file&amp;quot; button to download the new manifest file for the upgraded app.&lt;br /&gt;
==== Update Moodle app in Teams ====&lt;br /&gt;
# As a tenant admin, go to Teams.&lt;br /&gt;
# Go to &amp;quot;Apps&amp;quot; page to manage apps.&lt;br /&gt;
# From the menu on the left, click on the link &amp;quot;Built for YOUR ORGANISATION&amp;quot;. This should list all custom apps uploaded for your tenant.&lt;br /&gt;
# Locate the previous Moodle app, click the options button on the card for more options, and click &amp;quot;update&amp;quot;. This should open a file picker.&lt;br /&gt;
# Select the new manifest file downloaded from Moodle.&lt;br /&gt;
Note that as long as the &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039; setting is not changed, this should be recognised as an app upgrade, rather than uploading a new app. This means that the app will be kept in all existing Teams that have it installed, and all existing Moodle tabs will keep working.&lt;br /&gt;
==== Update Azure app settings ====&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Office 365 integration, and click its name.&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039;, select &#039;&#039;&#039;Expose an API&#039;&#039;&#039;.&lt;br /&gt;
# Select the &amp;quot;Set&amp;quot; link to generate the Application ID URI in the form of api://{AppID}. Insert your fully qualified domain name (with a forward slash &amp;quot;/&amp;quot; appended to the end) between the double forward slashes and the GUID. The entire ID should have the form of: api://fully-qualified-domain-name.com/{AppID}. e.g. api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000.&lt;br /&gt;
# If you get errors when selecting the &amp;quot;Set&amp;quot; link, it may be because the &#039;&#039;&#039;Supported account types&#039;&#039;&#039; setting of your app is set to a value rather than the one with &amp;quot;single tenant&amp;quot;. Try updating this value to get it working.&lt;br /&gt;
# Select the &amp;quot;Add a scope&amp;quot; button. In the panel that opens:&lt;br /&gt;
## enter &amp;quot;access_as_user&amp;quot; as the &amp;quot;Scope name&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to be &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to be &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to be &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to be &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;.&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
# In the Authorized client applications section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
## 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
## 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;API permissions&#039;&#039;&#039;, ensure the following permissions are added under &amp;quot;Microsoft Graph&amp;quot; &amp;gt; &amp;quot;Delegated permissions&amp;quot;:&lt;br /&gt;
## User.Read (enabled by default)&lt;br /&gt;
## email&lt;br /&gt;
## offline_access&lt;br /&gt;
## OpenId&lt;br /&gt;
## profile&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;Authentication&#039;&#039;&#039;, ensure the following boxes are checked for &amp;quot;implicit grant&amp;quot;:&lt;br /&gt;
## ID Token&lt;br /&gt;
## Access Token.&lt;br /&gt;
&lt;br /&gt;
==== Known limitations ====&lt;br /&gt;
It is a known issue that if an Office 365 user has never login to Moodle either, her first attempt to SSO from Teams to Moodle will not work silently. Instead, the user will need to click a button from the prompt to login.&lt;br /&gt;
&lt;br /&gt;
=== Single Sign Off ===&lt;br /&gt;
When an Office 365 authenticated user clicks the Moodle log out button, it is possible to log the user out from Office 365 at the same time.&lt;br /&gt;
&lt;br /&gt;
In order for this to work, configuration changes in two places are required:&lt;br /&gt;
==== Moodle settings change ==== &lt;br /&gt;
# Sign in Moodle as site admin.&lt;br /&gt;
# Go to &amp;quot;Microsoft Office 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Advanced&amp;quot; tab.&lt;br /&gt;
# Enable &amp;quot;Single sign off&amp;quot;.&lt;br /&gt;
# Save changes.&lt;br /&gt;
==== Azure app settings change ====&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Office 365 integration, and click its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the root URL of your Moodle site (wwwroot) as an entry.&lt;br /&gt;
&lt;br /&gt;
== 3.8.0.5 and 3.9.2 release==&lt;br /&gt;
3.8.0.5 and 3.9.2 release of the plugins on 18 November 2020 added support for synching the default timezone preference of the user in Outlook to Moodle. This requires the following permission to be granted for the Azure app:&lt;br /&gt;
# &#039;&#039;&#039;Delegated permissions&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Application permissions&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138756</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138756"/>
		<updated>2020-11-18T15:02:55Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* Configure application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need it later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;9&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;16&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;MailboxSettings.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write user mailbox settings&#039;&#039;&#039;&lt;br /&gt;
| Required for syncing Outlook default timezone settings of the user.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Office 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Office 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Office 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 for China&#039;&#039;&#039;: Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Office 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
= Notes on special release =&lt;br /&gt;
== 3.8.0.4 and 3.9.1 release==&lt;br /&gt;
3.8.0.4 and 3.9.1 release of the plugins on 29 September 2020 introduced improvements on SSO integration for Moodle in Teams as well as Single Sign Off support, but requires additional actions from Moodle and Azure admins.&lt;br /&gt;
=== Moodle and Teams SSO integration ===&lt;br /&gt;
The new releases is capable of getting a user token from either Teams desktop/mobile app or Teams web app, and attempt to log in as the user in the Moodle Teams tab. In order for it to work, changes in 3 sections are required.&lt;br /&gt;
==== Download updated manifest file ====&lt;br /&gt;
# Login to Moodle as site administrator.&lt;br /&gt;
# Go to &amp;quot;Microsoft Office 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Teams Settings&amp;quot; tab.&lt;br /&gt;
# Verify settings on the page, note that two new settings are added in this release:&lt;br /&gt;
## &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039;: This is used in the &amp;quot;ID&amp;quot; field of [https://docs.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema Teams app manifest file], which is essentially a self generated app ID to identify itself. It should be set to the default value in most use cases, otherwise it may affect upgrading of the Teams app. The only scenario a custom value is to be set for this setting is when there are multiple Moodle sites in the organisation, and they all need to be integrated with Teams, thus each site will require a separate Teams app. If custom value is required, please use [https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7 powershell] or [https://www.guidgenerator.com/ external tools] to generate valid ones.&lt;br /&gt;
## &#039;&#039;&#039;Teams app name&#039;&#039;&#039;: This allows you to give a custom name, rather than the default &amp;quot;Moodle&amp;quot;, to the Moodle Teams app created. It can be useful if you have multiple Moodle sites in your organisation, and each creating a separate Moodle app for Teams integration.&lt;br /&gt;
# Once settings are verified, save changes, go back to the tab, and click the &amp;quot;Download manifest file&amp;quot; button to download the new manifest file for the upgraded app.&lt;br /&gt;
==== Update Moodle app in Teams ====&lt;br /&gt;
# As a tenant admin, go to Teams.&lt;br /&gt;
# Go to &amp;quot;Apps&amp;quot; page to manage apps.&lt;br /&gt;
# From the menu on the left, click on the link &amp;quot;Built for YOUR ORGANISATION&amp;quot;. This should list all custom apps uploaded for your tenant.&lt;br /&gt;
# Locate the previous Moodle app, click the options button on the card for more options, and click &amp;quot;update&amp;quot;. This should open a file picker.&lt;br /&gt;
# Select the new manifest file downloaded from Moodle.&lt;br /&gt;
Note that as long as the &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039; setting is not changed, this should be recognised as an app upgrade, rather than uploading a new app. This means that the app will be kept in all existing Teams that have it installed, and all existing Moodle tabs will keep working.&lt;br /&gt;
==== Update Azure app settings ====&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Office 365 integration, and click its name.&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039;, select &#039;&#039;&#039;Expose an API&#039;&#039;&#039;.&lt;br /&gt;
# Select the &amp;quot;Set&amp;quot; link to generate the Application ID URI in the form of api://{AppID}. Insert your fully qualified domain name (with a forward slash &amp;quot;/&amp;quot; appended to the end) between the double forward slashes and the GUID. The entire ID should have the form of: api://fully-qualified-domain-name.com/{AppID}. e.g. api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000.&lt;br /&gt;
# If you get errors when selecting the &amp;quot;Set&amp;quot; link, it may be because the &#039;&#039;&#039;Supported account types&#039;&#039;&#039; setting of your app is set to a value rather than the one with &amp;quot;single tenant&amp;quot;. Try updating this value to get it working.&lt;br /&gt;
# Select the &amp;quot;Add a scope&amp;quot; button. In the panel that opens:&lt;br /&gt;
## enter &amp;quot;access_as_user&amp;quot; as the &amp;quot;Scope name&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to be &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to be &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to be &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to be &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;.&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
# In the Authorized client applications section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
## 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
## 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;API permissions&#039;&#039;&#039;, ensure the following permissions are added under &amp;quot;Microsoft Graph&amp;quot; &amp;gt; &amp;quot;Delegated permissions&amp;quot;:&lt;br /&gt;
## User.Read (enabled by default)&lt;br /&gt;
## email&lt;br /&gt;
## offline_access&lt;br /&gt;
## OpenId&lt;br /&gt;
## profile&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;Authentication&#039;&#039;&#039;, ensure the following boxes are checked for &amp;quot;implicit grant&amp;quot;:&lt;br /&gt;
## ID Token&lt;br /&gt;
## Access Token.&lt;br /&gt;
&lt;br /&gt;
==== Known limitations ====&lt;br /&gt;
It is a known issue that if an Office 365 user has never login to Moodle either, her first attempt to SSO from Teams to Moodle will not work silently. Instead, the user will need to click a button from the prompt to login.&lt;br /&gt;
&lt;br /&gt;
=== Single Sign Off ===&lt;br /&gt;
When an Office 365 authenticated user clicks the Moodle log out button, it is possible to log the user out from Office 365 at the same time.&lt;br /&gt;
&lt;br /&gt;
In order for this to work, configuration changes in two places are required:&lt;br /&gt;
==== Moodle settings change ==== &lt;br /&gt;
# Sign in Moodle as site admin.&lt;br /&gt;
# Go to &amp;quot;Microsoft Office 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Advanced&amp;quot; tab.&lt;br /&gt;
# Enable &amp;quot;Single sign off&amp;quot;.&lt;br /&gt;
# Save changes.&lt;br /&gt;
==== Azure app settings change ====&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Office 365 integration, and click its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the root URL of your Moodle site (wwwroot) as an entry.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138636</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138636"/>
		<updated>2020-10-06T14:30:48Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* Configure application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need it later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;14&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Office 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Office 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Office 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 for China&#039;&#039;&#039;: Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Office 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
= Notes on special release =&lt;br /&gt;
== 3.8.0.4 and 3.9.1 release==&lt;br /&gt;
3.8.0.4 and 3.9.1 release of the plugins on 29 September 2020 introduced improvements on SSO integration for Moodle in Teams as well as Single Sign Off support, but requires additional actions from Moodle and Azure admins.&lt;br /&gt;
=== Moodle and Teams SSO integration ===&lt;br /&gt;
The new releases is capable of getting a user token from either Teams desktop/mobile app or Teams web app, and attempt to log in as the user in the Moodle Teams tab. In order for it to work, changes in 3 sections are required.&lt;br /&gt;
==== Download updated manifest file ====&lt;br /&gt;
# Login to Moodle as site administrator.&lt;br /&gt;
# Go to &amp;quot;Microsoft Office 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Teams Settings&amp;quot; tab.&lt;br /&gt;
# Verify settings on the page, note that two new settings are added in this release:&lt;br /&gt;
## &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039;: This is used in the &amp;quot;ID&amp;quot; field of [https://docs.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema Teams app manifest file], which is essentially a self generated app ID to identify itself. It should be set to the default value in most use cases, otherwise it may affect upgrading of the Teams app. The only scenario a custom value is to be set for this setting is when there are multiple Moodle sites in the organisation, and they all need to be integrated with Teams, thus each site will require a separate Teams app. If custom value is required, please use [https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7 powershell] or [https://www.guidgenerator.com/ external tools] to generate valid ones.&lt;br /&gt;
## &#039;&#039;&#039;Teams app name&#039;&#039;&#039;: This allows you to give a custom name, rather than the default &amp;quot;Moodle&amp;quot;, to the Moodle Teams app created. It can be useful if you have multiple Moodle sites in your organisation, and each creating a separate Moodle app for Teams integration.&lt;br /&gt;
# Once settings are verified, save changes, go back to the tab, and click the &amp;quot;Download manifest file&amp;quot; button to download the new manifest file for the upgraded app.&lt;br /&gt;
==== Update Moodle app in Teams ====&lt;br /&gt;
# As a tenant admin, go to Teams.&lt;br /&gt;
# Go to &amp;quot;Apps&amp;quot; page to manage apps.&lt;br /&gt;
# From the menu on the left, click on the link &amp;quot;Built for YOUR ORGANISATION&amp;quot;. This should list all custom apps uploaded for your tenant.&lt;br /&gt;
# Locate the previous Moodle app, click the options button on the card for more options, and click &amp;quot;update&amp;quot;. This should open a file picker.&lt;br /&gt;
# Select the new manifest file downloaded from Moodle.&lt;br /&gt;
Note that as long as the &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039; setting is not changed, this should be recognised as an app upgrade, rather than uploading a new app. This means that the app will be kept in all existing Teams that have it installed, and all existing Moodle tabs will keep working.&lt;br /&gt;
==== Update Azure app settings ====&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Office 365 integration, and click its name.&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039;, select &#039;&#039;&#039;Expose an API&#039;&#039;&#039;.&lt;br /&gt;
# Select the &amp;quot;Set&amp;quot; link to generate the Application ID URI in the form of api://{AppID}. Insert your fully qualified domain name (with a forward slash &amp;quot;/&amp;quot; appended to the end) between the double forward slashes and the GUID. The entire ID should have the form of: api://fully-qualified-domain-name.com/{AppID}. e.g. api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000.&lt;br /&gt;
# If you get errors when selecting the &amp;quot;Set&amp;quot; link, it may be because the &#039;&#039;&#039;Supported account types&#039;&#039;&#039; setting of your app is set to a value rather than the one with &amp;quot;single tenant&amp;quot;. Try updating this value to get it working.&lt;br /&gt;
# Select the &amp;quot;Add a scope&amp;quot; button. In the panel that opens:&lt;br /&gt;
## enter &amp;quot;access_as_user&amp;quot; as the &amp;quot;Scope name&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to be &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to be &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to be &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to be &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;.&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
# In the Authorized client applications section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
## 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
## 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;API permissions&#039;&#039;&#039;, ensure the following permissions are added under &amp;quot;Microsoft Graph&amp;quot; &amp;gt; &amp;quot;Delegated permissions&amp;quot;:&lt;br /&gt;
## User.Read (enabled by default)&lt;br /&gt;
## email&lt;br /&gt;
## offline_access&lt;br /&gt;
## OpenId&lt;br /&gt;
## profile&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;Authentication&#039;&#039;&#039;, ensure the following boxes are checked for &amp;quot;implicit grant&amp;quot;:&lt;br /&gt;
## ID Token&lt;br /&gt;
## Access Token.&lt;br /&gt;
&lt;br /&gt;
==== Known limitations ====&lt;br /&gt;
It is a known issue that if an Office 365 user has never login to Moodle either, her first attempt to SSO from Teams to Moodle will not work silently. Instead, the user will need to click a button from the prompt to login.&lt;br /&gt;
&lt;br /&gt;
=== Single Sign Off ===&lt;br /&gt;
When an Office 365 authenticated user clicks the Moodle log out button, it is possible to log the user out from Office 365 at the same time.&lt;br /&gt;
&lt;br /&gt;
In order for this to work, configuration changes in two places are required:&lt;br /&gt;
==== Moodle settings change ==== &lt;br /&gt;
# Sign in Moodle as site admin.&lt;br /&gt;
# Go to &amp;quot;Microsoft Office 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Advanced&amp;quot; tab.&lt;br /&gt;
# Enable &amp;quot;Single sign off&amp;quot;.&lt;br /&gt;
# Save changes.&lt;br /&gt;
==== Azure app settings change ====&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Office 365 integration, and click its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the root URL of your Moodle site (wwwroot) as an entry.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138610</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138610"/>
		<updated>2020-10-02T10:36:55Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* Single Sign Off */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;14&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Office 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Office 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Office 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 for China&#039;&#039;&#039;: Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Office 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
= Notes on special release =&lt;br /&gt;
== 3.8.0.4 and 3.9.1 release==&lt;br /&gt;
3.8.0.4 and 3.9.1 release of the plugins on 29 September 2020 introduced improvements on SSO integration for Moodle in Teams as well as Single Sign Off support, but requires additional actions from Moodle and Azure admins.&lt;br /&gt;
=== Moodle and Teams SSO integration ===&lt;br /&gt;
The new releases is capable of getting a user token from either Teams desktop/mobile app or Teams web app, and attempt to log in as the user in the Moodle Teams tab. In order for it to work, changes in 3 sections are required.&lt;br /&gt;
==== Download updated manifest file ====&lt;br /&gt;
# Login to Moodle as site administrator.&lt;br /&gt;
# Go to &amp;quot;Microsoft Office 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Teams Settings&amp;quot; tab.&lt;br /&gt;
# Verify settings on the page, note that two new settings are added in this release:&lt;br /&gt;
## &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039;: This is used in the &amp;quot;ID&amp;quot; field of [https://docs.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema Teams app manifest file], which is essentially a self generated app ID to identify itself. It should be set to the default value in most use cases, otherwise it may affect upgrading of the Teams app. The only scenario a custom value is to be set for this setting is when there are multiple Moodle sites in the organisation, and they all need to be integrated with Teams, thus each site will require a separate Teams app. If custom value is required, please use [https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7 powershell] or [https://www.guidgenerator.com/ external tools] to generate valid ones.&lt;br /&gt;
## &#039;&#039;&#039;Teams app name&#039;&#039;&#039;: This allows you to give a custom name, rather than the default &amp;quot;Moodle&amp;quot;, to the Moodle Teams app created. It can be useful if you have multiple Moodle sites in your organisation, and each creating a separate Moodle app for Teams integration.&lt;br /&gt;
# Once settings are verified, save changes, go back to the tab, and click the &amp;quot;Download manifest file&amp;quot; button to download the new manifest file for the upgraded app.&lt;br /&gt;
==== Update Moodle app in Teams ====&lt;br /&gt;
# As a tenant admin, go to Teams.&lt;br /&gt;
# Go to &amp;quot;Apps&amp;quot; page to manage apps.&lt;br /&gt;
# From the menu on the left, click on the link &amp;quot;Built for YOUR ORGANISATION&amp;quot;. This should list all custom apps uploaded for your tenant.&lt;br /&gt;
# Locate the previous Moodle app, click the options button on the card for more options, and click &amp;quot;update&amp;quot;. This should open a file picker.&lt;br /&gt;
# Select the new manifest file downloaded from Moodle.&lt;br /&gt;
Note that as long as the &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039; setting is not changed, this should be recognised as an app upgrade, rather than uploading a new app. This means that the app will be kept in all existing Teams that have it installed, and all existing Moodle tabs will keep working.&lt;br /&gt;
==== Update Azure app settings ====&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Office 365 integration, and click its name.&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039;, select &#039;&#039;&#039;Expose an API&#039;&#039;&#039;.&lt;br /&gt;
# Select the &amp;quot;Set&amp;quot; link to generate the Application ID URI in the form of api://{AppID}. Insert your fully qualified domain name (with a forward slash &amp;quot;/&amp;quot; appended to the end) between the double forward slashes and the GUID. The entire ID should have the form of: api://fully-qualified-domain-name.com/{AppID}. e.g. api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000.&lt;br /&gt;
# If you get errors when selecting the &amp;quot;Set&amp;quot; link, it may be because the &#039;&#039;&#039;Supported account types&#039;&#039;&#039; setting of your app is set to a value rather than the one with &amp;quot;single tenant&amp;quot;. Try updating this value to get it working.&lt;br /&gt;
# Select the &amp;quot;Add a scope&amp;quot; button. In the panel that opens:&lt;br /&gt;
## enter &amp;quot;access_as_user&amp;quot; as the &amp;quot;Scope name&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to be &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to be &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to be &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to be &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;.&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
# In the Authorized client applications section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
## 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
## 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;API permissions&#039;&#039;&#039;, ensure the following permissions are added under &amp;quot;Microsoft Graph&amp;quot; &amp;gt; &amp;quot;Delegated permissions&amp;quot;:&lt;br /&gt;
## User.Read (enabled by default)&lt;br /&gt;
## email&lt;br /&gt;
## offline_access&lt;br /&gt;
## OpenId&lt;br /&gt;
## profile&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;Authentication&#039;&#039;&#039;, ensure the following boxes are checked for &amp;quot;implicit grant&amp;quot;:&lt;br /&gt;
## ID Token&lt;br /&gt;
## Access Token.&lt;br /&gt;
&lt;br /&gt;
==== Known limitations ====&lt;br /&gt;
It is a known issue that if an Office 365 user has never login to Moodle either, her first attempt to SSO from Teams to Moodle will not work silently. Instead, the user will need to click a button from the prompt to login.&lt;br /&gt;
&lt;br /&gt;
=== Single Sign Off ===&lt;br /&gt;
When an Office 365 authenticated user clicks the Moodle log out button, it is possible to log the user out from Office 365 at the same time.&lt;br /&gt;
&lt;br /&gt;
In order for this to work, configuration changes in two places are required:&lt;br /&gt;
==== Moodle settings change ==== &lt;br /&gt;
# Sign in Moodle as site admin.&lt;br /&gt;
# Go to &amp;quot;Microsoft Office 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Advanced&amp;quot; tab.&lt;br /&gt;
# Enable &amp;quot;Single sign off&amp;quot;.&lt;br /&gt;
# Save changes.&lt;br /&gt;
==== Azure app settings change ====&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Office 365 integration, and click its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the root URL of your Moodle site (wwwroot) as an entry.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138609</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138609"/>
		<updated>2020-10-02T10:36:42Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* Single Sign Off */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;14&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Office 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Office 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Office 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 for China&#039;&#039;&#039;: Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Office 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
= Notes on special release =&lt;br /&gt;
== 3.8.0.4 and 3.9.1 release==&lt;br /&gt;
3.8.0.4 and 3.9.1 release of the plugins on 29 September 2020 introduced improvements on SSO integration for Moodle in Teams as well as Single Sign Off support, but requires additional actions from Moodle and Azure admins.&lt;br /&gt;
=== Moodle and Teams SSO integration ===&lt;br /&gt;
The new releases is capable of getting a user token from either Teams desktop/mobile app or Teams web app, and attempt to log in as the user in the Moodle Teams tab. In order for it to work, changes in 3 sections are required.&lt;br /&gt;
==== Download updated manifest file ====&lt;br /&gt;
# Login to Moodle as site administrator.&lt;br /&gt;
# Go to &amp;quot;Microsoft Office 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Teams Settings&amp;quot; tab.&lt;br /&gt;
# Verify settings on the page, note that two new settings are added in this release:&lt;br /&gt;
## &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039;: This is used in the &amp;quot;ID&amp;quot; field of [https://docs.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema Teams app manifest file], which is essentially a self generated app ID to identify itself. It should be set to the default value in most use cases, otherwise it may affect upgrading of the Teams app. The only scenario a custom value is to be set for this setting is when there are multiple Moodle sites in the organisation, and they all need to be integrated with Teams, thus each site will require a separate Teams app. If custom value is required, please use [https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7 powershell] or [https://www.guidgenerator.com/ external tools] to generate valid ones.&lt;br /&gt;
## &#039;&#039;&#039;Teams app name&#039;&#039;&#039;: This allows you to give a custom name, rather than the default &amp;quot;Moodle&amp;quot;, to the Moodle Teams app created. It can be useful if you have multiple Moodle sites in your organisation, and each creating a separate Moodle app for Teams integration.&lt;br /&gt;
# Once settings are verified, save changes, go back to the tab, and click the &amp;quot;Download manifest file&amp;quot; button to download the new manifest file for the upgraded app.&lt;br /&gt;
==== Update Moodle app in Teams ====&lt;br /&gt;
# As a tenant admin, go to Teams.&lt;br /&gt;
# Go to &amp;quot;Apps&amp;quot; page to manage apps.&lt;br /&gt;
# From the menu on the left, click on the link &amp;quot;Built for YOUR ORGANISATION&amp;quot;. This should list all custom apps uploaded for your tenant.&lt;br /&gt;
# Locate the previous Moodle app, click the options button on the card for more options, and click &amp;quot;update&amp;quot;. This should open a file picker.&lt;br /&gt;
# Select the new manifest file downloaded from Moodle.&lt;br /&gt;
Note that as long as the &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039; setting is not changed, this should be recognised as an app upgrade, rather than uploading a new app. This means that the app will be kept in all existing Teams that have it installed, and all existing Moodle tabs will keep working.&lt;br /&gt;
==== Update Azure app settings ====&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Office 365 integration, and click its name.&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039;, select &#039;&#039;&#039;Expose an API&#039;&#039;&#039;.&lt;br /&gt;
# Select the &amp;quot;Set&amp;quot; link to generate the Application ID URI in the form of api://{AppID}. Insert your fully qualified domain name (with a forward slash &amp;quot;/&amp;quot; appended to the end) between the double forward slashes and the GUID. The entire ID should have the form of: api://fully-qualified-domain-name.com/{AppID}. e.g. api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000.&lt;br /&gt;
# If you get errors when selecting the &amp;quot;Set&amp;quot; link, it may be because the &#039;&#039;&#039;Supported account types&#039;&#039;&#039; setting of your app is set to a value rather than the one with &amp;quot;single tenant&amp;quot;. Try updating this value to get it working.&lt;br /&gt;
# Select the &amp;quot;Add a scope&amp;quot; button. In the panel that opens:&lt;br /&gt;
## enter &amp;quot;access_as_user&amp;quot; as the &amp;quot;Scope name&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to be &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to be &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to be &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to be &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;.&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
# In the Authorized client applications section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
## 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
## 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;API permissions&#039;&#039;&#039;, ensure the following permissions are added under &amp;quot;Microsoft Graph&amp;quot; &amp;gt; &amp;quot;Delegated permissions&amp;quot;:&lt;br /&gt;
## User.Read (enabled by default)&lt;br /&gt;
## email&lt;br /&gt;
## offline_access&lt;br /&gt;
## OpenId&lt;br /&gt;
## profile&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;Authentication&#039;&#039;&#039;, ensure the following boxes are checked for &amp;quot;implicit grant&amp;quot;:&lt;br /&gt;
## ID Token&lt;br /&gt;
## Access Token.&lt;br /&gt;
&lt;br /&gt;
==== Known limitations ====&lt;br /&gt;
It is a known issue that if an Office 365 user has never login to Moodle either, her first attempt to SSO from Teams to Moodle will not work silently. Instead, the user will need to click a button from the prompt to login.&lt;br /&gt;
&lt;br /&gt;
=== Single Sign Off ===&lt;br /&gt;
When an Office 365 authenticated user clicks the Moodle log out button, it is possible to log the users out from Office 365 at the same time.&lt;br /&gt;
&lt;br /&gt;
In order for this to work, configuration changes in two places are required:&lt;br /&gt;
==== Moodle settings change ==== &lt;br /&gt;
# Sign in Moodle as site admin.&lt;br /&gt;
# Go to &amp;quot;Microsoft Office 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Advanced&amp;quot; tab.&lt;br /&gt;
# Enable &amp;quot;Single sign off&amp;quot;.&lt;br /&gt;
# Save changes.&lt;br /&gt;
==== Azure app settings change ====&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Office 365 integration, and click its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the root URL of your Moodle site (wwwroot) as an entry.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138603</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138603"/>
		<updated>2020-09-28T22:04:39Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;14&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Office 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Office 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Office 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 for China&#039;&#039;&#039;: Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Office 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
= Notes on special release =&lt;br /&gt;
== 3.8.0.4 and 3.9.1 release==&lt;br /&gt;
3.8.0.4 and 3.9.1 release of the plugins on 29 September 2020 introduced improvements on SSO integration for Moodle in Teams as well as Single Sign Off support, but requires additional actions from Moodle and Azure admins.&lt;br /&gt;
=== Moodle and Teams SSO integration ===&lt;br /&gt;
The new releases is capable of getting a user token from either Teams desktop/mobile app or Teams web app, and attempt to log in as the user in the Moodle Teams tab. In order for it to work, changes in 3 sections are required.&lt;br /&gt;
==== Download updated manifest file ====&lt;br /&gt;
# Login to Moodle as site administrator.&lt;br /&gt;
# Go to &amp;quot;Microsoft Office 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Teams Settings&amp;quot; tab.&lt;br /&gt;
# Verify settings on the page, note that two new settings are added in this release:&lt;br /&gt;
## &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039;: This is used in the &amp;quot;ID&amp;quot; field of [https://docs.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema Teams app manifest file], which is essentially a self generated app ID to identify itself. It should be set to the default value in most use cases, otherwise it may affect upgrading of the Teams app. The only scenario a custom value is to be set for this setting is when there are multiple Moodle sites in the organisation, and they all need to be integrated with Teams, thus each site will require a separate Teams app. If custom value is required, please use [https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7 powershell] or [https://www.guidgenerator.com/ external tools] to generate valid ones.&lt;br /&gt;
## &#039;&#039;&#039;Teams app name&#039;&#039;&#039;: This allows you to give a custom name, rather than the default &amp;quot;Moodle&amp;quot;, to the Moodle Teams app created. It can be useful if you have multiple Moodle sites in your organisation, and each creating a separate Moodle app for Teams integration.&lt;br /&gt;
# Once settings are verified, save changes, go back to the tab, and click the &amp;quot;Download manifest file&amp;quot; button to download the new manifest file for the upgraded app.&lt;br /&gt;
==== Update Moodle app in Teams ====&lt;br /&gt;
# As a tenant admin, go to Teams.&lt;br /&gt;
# Go to &amp;quot;Apps&amp;quot; page to manage apps.&lt;br /&gt;
# From the menu on the left, click on the link &amp;quot;Built for YOUR ORGANISATION&amp;quot;. This should list all custom apps uploaded for your tenant.&lt;br /&gt;
# Locate the previous Moodle app, click the options button on the card for more options, and click &amp;quot;update&amp;quot;. This should open a file picker.&lt;br /&gt;
# Select the new manifest file downloaded from Moodle.&lt;br /&gt;
Note that as long as the &#039;&#039;&#039;Microsoft app ID for the Moodle Teams app&#039;&#039;&#039; setting is not changed, this should be recognised as an app upgrade, rather than uploading a new app. This means that the app will be kept in all existing Teams that have it installed, and all existing Moodle tabs will keep working.&lt;br /&gt;
==== Update Azure app settings ====&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Office 365 integration, and click its name.&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039;, select &#039;&#039;&#039;Expose an API&#039;&#039;&#039;.&lt;br /&gt;
# Select the &amp;quot;Set&amp;quot; link to generate the Application ID URI in the form of api://{AppID}. Insert your fully qualified domain name (with a forward slash &amp;quot;/&amp;quot; appended to the end) between the double forward slashes and the GUID. The entire ID should have the form of: api://fully-qualified-domain-name.com/{AppID}. e.g. api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000.&lt;br /&gt;
# If you get errors when selecting the &amp;quot;Set&amp;quot; link, it may be because the &#039;&#039;&#039;Supported account types&#039;&#039;&#039; setting of your app is set to a value rather than the one with &amp;quot;single tenant&amp;quot;. Try updating this value to get it working.&lt;br /&gt;
# Select the &amp;quot;Add a scope&amp;quot; button. In the panel that opens:&lt;br /&gt;
## enter &amp;quot;access_as_user&amp;quot; as the &amp;quot;Scope name&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to be &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to be &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to be &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to be &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;.&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
# In the Authorized client applications section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
## 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
## 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;API permissions&#039;&#039;&#039;, ensure the following permissions are added under &amp;quot;Microsoft Graph&amp;quot; &amp;gt; &amp;quot;Delegated permissions&amp;quot;:&lt;br /&gt;
## User.Read (enabled by default)&lt;br /&gt;
## email&lt;br /&gt;
## offline_access&lt;br /&gt;
## OpenId&lt;br /&gt;
## profile&lt;br /&gt;
# Under &#039;&#039;&#039;Manage&#039;&#039;&#039; then &#039;&#039;&#039;Authentication&#039;&#039;&#039;, ensure the following boxes are checked for &amp;quot;implicit grant&amp;quot;:&lt;br /&gt;
## ID Token&lt;br /&gt;
## Access Token.&lt;br /&gt;
&lt;br /&gt;
==== Known limitations ====&lt;br /&gt;
It is a known issue that if an Office 365 user has never login to Moodle either, her first attempt to SSO from Teams to Moodle will not work silently. Instead, the user will need to click a button from the prompt to login.&lt;br /&gt;
&lt;br /&gt;
=== Single Sign Off ===&lt;br /&gt;
When an Office 365 authenticate users clicks the Moodle log out button, it is possible to log the users out from Office 365 at the same time.&lt;br /&gt;
&lt;br /&gt;
In order for this to work, configuration changes in two places are required:&lt;br /&gt;
==== Moodle settings change ==== &lt;br /&gt;
# Sign in Moodle as site admin.&lt;br /&gt;
# Go to &amp;quot;Microsoft Office 365 Integration&amp;quot; page in the site admin section.&lt;br /&gt;
# Go to &amp;quot;Advanced&amp;quot; tab.&lt;br /&gt;
# Enable &amp;quot;Single sign off&amp;quot;.&lt;br /&gt;
# Save changes.&lt;br /&gt;
==== Azure app settings change ====&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Locate the app used for Moodle and Office 365 integration, and click its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the root URL of your Moodle site (wwwroot) as an entry.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138602</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138602"/>
		<updated>2020-09-28T20:53:19Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* FAQ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;14&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Office 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Office 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Office 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 for China&#039;&#039;&#039;: Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Office 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138601</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138601"/>
		<updated>2020-09-28T20:50:15Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* Add Teams Moodle app ID back to Moodle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;14&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Office 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Office 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Office 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 for China&#039;&#039;&#039;: Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Office 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
==How will cookie changes in Chrome version 80 affect Teams integration?==&lt;br /&gt;
The stable release of the Google Chrome web browser (build 80, scheduled for release on February 4, 2020) features a change in how cookies are handled. This will include two changes:&lt;br /&gt;
* Cookies without a &#039;&#039;&#039;SameSite&#039;&#039;&#039; attribute will be treated as SameSite=Lax.&lt;br /&gt;
* Cookies with &#039;&#039;&#039;SameSite=None&#039;&#039;&#039; must also specify &#039;&#039;&#039;Secure&#039;&#039;&#039;, meaning they require a secure context.&lt;br /&gt;
The changes are explained in [https://web.dev/samesite-cookies-explained/ here] and [https://blog.chromium.org/2019/10/developers-get-ready-for-new.html here]&lt;br /&gt;
&lt;br /&gt;
Moodle and Microsoft Teams integration will be affected by this change, because the integration requires embedding Moodle pages in Teams. There is [https://tracker.moodle.org/browse/MDL-67175 an open item] in Moodle tracker about this change in general, but the code change proposed in the tracker item didn&#039;t get integrated in time for the last minor Moodle upgrade before Chrome 80 release date. As a result, all sites using Moodle and Microsoft Teams integration feature are strongly suggested to apply the patches proposed in the [https://tracker.moodle.org/browse/MDL-67175 tracker item] so that users with Chrome 80 can keep using Moodle tabs in Teams after upgrade.&lt;br /&gt;
* Patches are provided for all Moodle versions that are supported for core feature and security issues, i.e. 3.5, 3.6, 3.7 and 3.8.&lt;br /&gt;
* Patches are only required before this is integrated into the next Moodle minor release of the Moodle versions, which is scheduled at March 9th, 2020.&lt;br /&gt;
* After the next Moodle minor release, the patch should be removed as it would be integration into core Moodle code.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138600</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138600"/>
		<updated>2020-09-28T20:49:42Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* Teams Settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;14&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Office 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Office 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Office 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 for China&#039;&#039;&#039;: Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Office 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in the general channel of the created Team, linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
=== Add Teams Moodle app ID back to Moodle ===&lt;br /&gt;
After Moodle app is added to Teams, you can go to &amp;quot;Teams Moodle app&amp;quot; tab, and follow steps on the page to set Teams Moodle app ID in Moodle. This will allow Moodle to automatically add The Teams Moodle app to the Teams created from the sync, and create a new Moodle tab in the general channel of the newly create Team, linking to the Moodle course page.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
==How will cookie changes in Chrome version 80 affect Teams integration?==&lt;br /&gt;
The stable release of the Google Chrome web browser (build 80, scheduled for release on February 4, 2020) features a change in how cookies are handled. This will include two changes:&lt;br /&gt;
* Cookies without a &#039;&#039;&#039;SameSite&#039;&#039;&#039; attribute will be treated as SameSite=Lax.&lt;br /&gt;
* Cookies with &#039;&#039;&#039;SameSite=None&#039;&#039;&#039; must also specify &#039;&#039;&#039;Secure&#039;&#039;&#039;, meaning they require a secure context.&lt;br /&gt;
The changes are explained in [https://web.dev/samesite-cookies-explained/ here] and [https://blog.chromium.org/2019/10/developers-get-ready-for-new.html here]&lt;br /&gt;
&lt;br /&gt;
Moodle and Microsoft Teams integration will be affected by this change, because the integration requires embedding Moodle pages in Teams. There is [https://tracker.moodle.org/browse/MDL-67175 an open item] in Moodle tracker about this change in general, but the code change proposed in the tracker item didn&#039;t get integrated in time for the last minor Moodle upgrade before Chrome 80 release date. As a result, all sites using Moodle and Microsoft Teams integration feature are strongly suggested to apply the patches proposed in the [https://tracker.moodle.org/browse/MDL-67175 tracker item] so that users with Chrome 80 can keep using Moodle tabs in Teams after upgrade.&lt;br /&gt;
* Patches are provided for all Moodle versions that are supported for core feature and security issues, i.e. 3.5, 3.6, 3.7 and 3.8.&lt;br /&gt;
* Patches are only required before this is integrated into the next Moodle minor release of the Moodle versions, which is scheduled at March 9th, 2020.&lt;br /&gt;
* After the next Moodle minor release, the patch should be removed as it would be integration into core Moodle code.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138599</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138599"/>
		<updated>2020-09-28T20:40:02Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* User Sync */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;14&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Office 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third column on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Office 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Office 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 for China&#039;&#039;&#039;: Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Office 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in Team linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
==How will cookie changes in Chrome version 80 affect Teams integration?==&lt;br /&gt;
The stable release of the Google Chrome web browser (build 80, scheduled for release on February 4, 2020) features a change in how cookies are handled. This will include two changes:&lt;br /&gt;
* Cookies without a &#039;&#039;&#039;SameSite&#039;&#039;&#039; attribute will be treated as SameSite=Lax.&lt;br /&gt;
* Cookies with &#039;&#039;&#039;SameSite=None&#039;&#039;&#039; must also specify &#039;&#039;&#039;Secure&#039;&#039;&#039;, meaning they require a secure context.&lt;br /&gt;
The changes are explained in [https://web.dev/samesite-cookies-explained/ here] and [https://blog.chromium.org/2019/10/developers-get-ready-for-new.html here]&lt;br /&gt;
&lt;br /&gt;
Moodle and Microsoft Teams integration will be affected by this change, because the integration requires embedding Moodle pages in Teams. There is [https://tracker.moodle.org/browse/MDL-67175 an open item] in Moodle tracker about this change in general, but the code change proposed in the tracker item didn&#039;t get integrated in time for the last minor Moodle upgrade before Chrome 80 release date. As a result, all sites using Moodle and Microsoft Teams integration feature are strongly suggested to apply the patches proposed in the [https://tracker.moodle.org/browse/MDL-67175 tracker item] so that users with Chrome 80 can keep using Moodle tabs in Teams after upgrade.&lt;br /&gt;
* Patches are provided for all Moodle versions that are supported for core feature and security issues, i.e. 3.5, 3.6, 3.7 and 3.8.&lt;br /&gt;
* Patches are only required before this is integrated into the next Moodle minor release of the Moodle versions, which is scheduled at March 9th, 2020.&lt;br /&gt;
* After the next Moodle minor release, the patch should be removed as it would be integration into core Moodle code.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138598</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138598"/>
		<updated>2020-09-28T20:39:49Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* User Sync */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;14&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Office 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third colume on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Office 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Office 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 for China&#039;&#039;&#039;: Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Office 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in Team linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
==How will cookie changes in Chrome version 80 affect Teams integration?==&lt;br /&gt;
The stable release of the Google Chrome web browser (build 80, scheduled for release on February 4, 2020) features a change in how cookies are handled. This will include two changes:&lt;br /&gt;
* Cookies without a &#039;&#039;&#039;SameSite&#039;&#039;&#039; attribute will be treated as SameSite=Lax.&lt;br /&gt;
* Cookies with &#039;&#039;&#039;SameSite=None&#039;&#039;&#039; must also specify &#039;&#039;&#039;Secure&#039;&#039;&#039;, meaning they require a secure context.&lt;br /&gt;
The changes are explained in [https://web.dev/samesite-cookies-explained/ here] and [https://blog.chromium.org/2019/10/developers-get-ready-for-new.html here]&lt;br /&gt;
&lt;br /&gt;
Moodle and Microsoft Teams integration will be affected by this change, because the integration requires embedding Moodle pages in Teams. There is [https://tracker.moodle.org/browse/MDL-67175 an open item] in Moodle tracker about this change in general, but the code change proposed in the tracker item didn&#039;t get integrated in time for the last minor Moodle upgrade before Chrome 80 release date. As a result, all sites using Moodle and Microsoft Teams integration feature are strongly suggested to apply the patches proposed in the [https://tracker.moodle.org/browse/MDL-67175 tracker item] so that users with Chrome 80 can keep using Moodle tabs in Teams after upgrade.&lt;br /&gt;
* Patches are provided for all Moodle versions that are supported for core feature and security issues, i.e. 3.5, 3.6, 3.7 and 3.8.&lt;br /&gt;
* Patches are only required before this is integrated into the next Moodle minor release of the Moodle versions, which is scheduled at March 9th, 2020.&lt;br /&gt;
* After the next Moodle minor release, the patch should be removed as it would be integration into core Moodle code.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138597</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138597"/>
		<updated>2020-09-28T20:39:32Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* User Sync */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;14&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
* &#039;&#039;&#039;Create accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
* &#039;&#039;&#039;Update all accounts in Moodle for users in Azure AD&#039;&#039;&#039;: This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
* &#039;&#039;&#039;Delete previously synced accounts in Moodle when they are deleted from Azure AD&#039;&#039;&#039;: This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
* &#039;&#039;&#039;Match preexisting Moodle users with same-named accounts in Azure AD&#039;&#039;&#039;: This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are insensitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
* &#039;&#039;&#039;Switch matched users to Office 365 (OpenID Connect) authentication&#039;&#039;&#039;: This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
* &#039;&#039;&#039;Assign users to application during sync&#039;&#039;&#039;: The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle in cron job&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
* &#039;&#039;&#039;Sync Office 365 profile photos to Moodle on login&#039;&#039;&#039;: User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
* &#039;&#039;&#039;Perform a full sync each run&#039;&#039;&#039;: By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
* &#039;&#039;&#039;Match Azure usernames to Moodle emails instead of Moodle usernames during the sync&#039;&#039;&#039;: Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third colum on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Office 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Office 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 for China&#039;&#039;&#039;: Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Office 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in Team linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
==How will cookie changes in Chrome version 80 affect Teams integration?==&lt;br /&gt;
The stable release of the Google Chrome web browser (build 80, scheduled for release on February 4, 2020) features a change in how cookies are handled. This will include two changes:&lt;br /&gt;
* Cookies without a &#039;&#039;&#039;SameSite&#039;&#039;&#039; attribute will be treated as SameSite=Lax.&lt;br /&gt;
* Cookies with &#039;&#039;&#039;SameSite=None&#039;&#039;&#039; must also specify &#039;&#039;&#039;Secure&#039;&#039;&#039;, meaning they require a secure context.&lt;br /&gt;
The changes are explained in [https://web.dev/samesite-cookies-explained/ here] and [https://blog.chromium.org/2019/10/developers-get-ready-for-new.html here]&lt;br /&gt;
&lt;br /&gt;
Moodle and Microsoft Teams integration will be affected by this change, because the integration requires embedding Moodle pages in Teams. There is [https://tracker.moodle.org/browse/MDL-67175 an open item] in Moodle tracker about this change in general, but the code change proposed in the tracker item didn&#039;t get integrated in time for the last minor Moodle upgrade before Chrome 80 release date. As a result, all sites using Moodle and Microsoft Teams integration feature are strongly suggested to apply the patches proposed in the [https://tracker.moodle.org/browse/MDL-67175 tracker item] so that users with Chrome 80 can keep using Moodle tabs in Teams after upgrade.&lt;br /&gt;
* Patches are provided for all Moodle versions that are supported for core feature and security issues, i.e. 3.5, 3.6, 3.7 and 3.8.&lt;br /&gt;
* Patches are only required before this is integrated into the next Moodle minor release of the Moodle versions, which is scheduled at March 9th, 2020.&lt;br /&gt;
* After the next Moodle minor release, the patch should be removed as it would be integration into core Moodle code.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138596</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138596"/>
		<updated>2020-09-28T20:33:51Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* Advanced settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;14&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
&lt;br /&gt;
==== Create accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
&lt;br /&gt;
==== Update all accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
&lt;br /&gt;
==== Delete previously synced accounts in Moodle when they are deleted from Azure AD ====&lt;br /&gt;
This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
&lt;br /&gt;
==== Match preexisting Moodle users with same-named accounts in Azure AD ====&lt;br /&gt;
This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are case-insentitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
&lt;br /&gt;
==== Switch matched users to Office 365 (OpenID Connect) authentication ====&lt;br /&gt;
This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
&lt;br /&gt;
==== Assign users to application during sync ====&lt;br /&gt;
&lt;br /&gt;
The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle in cron job ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle on login ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
&lt;br /&gt;
==== Perform a full sync each run ====&lt;br /&gt;
&lt;br /&gt;
By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
&lt;br /&gt;
==== Match Azure usernames to moodle emails instead of moodle usernames during the sync ====&lt;br /&gt;
&lt;br /&gt;
Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third colum on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Tenants&#039;&#039;&#039;: This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
* &#039;&#039;&#039;Health check&#039;&#039;&#039;: If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
* &#039;&#039;&#039;Connections&#039;&#039;&#039;: This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
* &#039;&#039;&#039;User Matching&#039;&#039;&#039;: This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user. Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
* &#039;&#039;&#039;Maintenance Tools&#039;&#039;&#039;: These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
** &#039;&#039;&#039;Resync users in groups for courses&#039;&#039;&#039;: Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
** &#039;&#039;&#039;Recreate deleted Office 365 groups&#039;&#039;&#039;: Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
** &#039;&#039;&#039;Generate debug data package&#039;&#039;&#039;:  This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup OpenID Connect Tokens&#039;&#039;&#039;: If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors. WARNING: This may interrupt logins in-process, so it&#039;s best to do this during downtime.&lt;br /&gt;
** &#039;&#039;&#039;Cleanup User Sync Delta Tokens&#039;&#039;&#039;: If user synchronisation is not fully working after updating it user sync settings, it may be caused by an old delta sync token. Cleaning up the token will remove force a complete re-sync the next time when the user sync is run.&lt;br /&gt;
&lt;br /&gt;
===Other advanced settings===&lt;br /&gt;
* &#039;&#039;&#039;Single sign off&#039;&#039;&#039;: If enabled, when a Moodle user using OIDC authentication method signs off from Moodle, Moodle will attempt to log the user off from Office 365 as well.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 for China&#039;&#039;&#039;: Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
* &#039;&#039;&#039;Record debug messages&#039;&#039;&#039;: If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Minimum inexact username length to switch to Office 365&#039;&#039;&#039;: When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
* &#039;&#039;&#039;Profile photo refresh time&#039;&#039;&#039;: Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
* &#039;&#039;&#039;Custom theme (Advanced)&#039;&#039;&#039;: This allows you to choose the theme to use in when accessing Moodle pages from the Moodle Teams tab.&lt;br /&gt;
&lt;br /&gt;
===Legacy settings===&lt;br /&gt;
&#039;&#039;&#039;These features are deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Preview features===&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in Team linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
==How will cookie changes in Chrome version 80 affect Teams integration?==&lt;br /&gt;
The stable release of the Google Chrome web browser (build 80, scheduled for release on February 4, 2020) features a change in how cookies are handled. This will include two changes:&lt;br /&gt;
* Cookies without a &#039;&#039;&#039;SameSite&#039;&#039;&#039; attribute will be treated as SameSite=Lax.&lt;br /&gt;
* Cookies with &#039;&#039;&#039;SameSite=None&#039;&#039;&#039; must also specify &#039;&#039;&#039;Secure&#039;&#039;&#039;, meaning they require a secure context.&lt;br /&gt;
The changes are explained in [https://web.dev/samesite-cookies-explained/ here] and [https://blog.chromium.org/2019/10/developers-get-ready-for-new.html here]&lt;br /&gt;
&lt;br /&gt;
Moodle and Microsoft Teams integration will be affected by this change, because the integration requires embedding Moodle pages in Teams. There is [https://tracker.moodle.org/browse/MDL-67175 an open item] in Moodle tracker about this change in general, but the code change proposed in the tracker item didn&#039;t get integrated in time for the last minor Moodle upgrade before Chrome 80 release date. As a result, all sites using Moodle and Microsoft Teams integration feature are strongly suggested to apply the patches proposed in the [https://tracker.moodle.org/browse/MDL-67175 tracker item] so that users with Chrome 80 can keep using Moodle tabs in Teams after upgrade.&lt;br /&gt;
* Patches are provided for all Moodle versions that are supported for core feature and security issues, i.e. 3.5, 3.6, 3.7 and 3.8.&lt;br /&gt;
* Patches are only required before this is integrated into the next Moodle minor release of the Moodle versions, which is scheduled at March 9th, 2020.&lt;br /&gt;
* After the next Moodle minor release, the patch should be removed as it would be integration into core Moodle code.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138595</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138595"/>
		<updated>2020-09-28T15:29:46Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* Configure application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;14&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
&lt;br /&gt;
==== Create accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
&lt;br /&gt;
==== Update all accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
&lt;br /&gt;
==== Delete previously synced accounts in Moodle when they are deleted from Azure AD ====&lt;br /&gt;
This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
&lt;br /&gt;
==== Match preexisting Moodle users with same-named accounts in Azure AD ====&lt;br /&gt;
This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are case-insentitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
&lt;br /&gt;
==== Switch matched users to Office 365 (OpenID Connect) authentication ====&lt;br /&gt;
This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
&lt;br /&gt;
==== Assign users to application during sync ====&lt;br /&gt;
&lt;br /&gt;
The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle in cron job ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle on login ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
&lt;br /&gt;
==== Perform a full sync each run ====&lt;br /&gt;
&lt;br /&gt;
By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
&lt;br /&gt;
==== Match Azure usernames to moodle emails instead of moodle usernames during the sync ====&lt;br /&gt;
&lt;br /&gt;
Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third colum on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
====Tenants====&lt;br /&gt;
This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
&lt;br /&gt;
====Health Check====&lt;br /&gt;
If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
&lt;br /&gt;
====User Matching====&lt;br /&gt;
This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user.&lt;br /&gt;
&lt;br /&gt;
Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
&lt;br /&gt;
====Maintenance Tools====&lt;br /&gt;
These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
&lt;br /&gt;
=====Resync users in groups for courses=====&lt;br /&gt;
Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
&lt;br /&gt;
=====Recreate deleted Office 365 groups=====&lt;br /&gt;
Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
&lt;br /&gt;
=====Generate debug data package=====&lt;br /&gt;
This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
&lt;br /&gt;
=====Cleanup OpenID Connect Tokens=====&lt;br /&gt;
If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors.&lt;br /&gt;
&lt;br /&gt;
====Advanced settings====&lt;br /&gt;
=====Office 365 for China=====&lt;br /&gt;
Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
=====Record debug messages=====&lt;br /&gt;
If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
=====Minimum inexact username length to switch to Office 365=====&lt;br /&gt;
When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
=====Profile photo refresh time=====&lt;br /&gt;
Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
&lt;br /&gt;
====Legacy settings====&lt;br /&gt;
===== SharePoint Link =====&lt;br /&gt;
&#039;&#039;&#039;This feature is deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SharePoint sites can be created for each course on your Moodle site. You will provide a parent SharePoint site and subsites for each course will be automatically created. The document library for each of these subsites can then be accessed by teachers using the OneDrive for Business repository. This provides a shared store of files for a course, allowing teachers to collaborate on documents and share resources.&lt;br /&gt;
&lt;br /&gt;
* Any AzureAD-connected Moodle user with the &#039;&#039;&#039;moodle/course:managefiles&#039;&#039;&#039; capability in a course will be able to access the document library from the repository.&lt;br /&gt;
&lt;br /&gt;
====== Setting up the SharePoint connection ======&lt;br /&gt;
# Visit the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration).&lt;br /&gt;
# Under the &#039;&#039;&#039;Options&#039;&#039;&#039; tab, look for the &#039;&#039;&#039;SharePoint Link&#039;&#039;&#039; setting.&lt;br /&gt;
# Type in the URL of the parent SharePoint site you&#039;d like to use for the course subsites.&lt;br /&gt;
## This should be the entire URL to the SharePoint site - for example: &#039;&#039;&#039;https://contoso.sharepoint.com/moodle&#039;&#039;&#039;.&lt;br /&gt;
## This site must be accessible to the &#039;&#039;&#039;System API user&#039;&#039;&#039;&lt;br /&gt;
# When you are done typing in the URL, the URL will be checked for suitability.&lt;br /&gt;
## If the valid is invalid, you will see a red box and the text &amp;quot;This is not a usable SharePoint site.&amp;quot;&lt;br /&gt;
## If the site already exists, you will see a blue box and the text &amp;quot;This site is usable, but already exists&amp;quot;. You can use this site, but conflicts can arise. It&#039;s recommended to use a URL to a SharePoint site that doesn&#039;t yet exist. The site will be created during initialization.&lt;br /&gt;
## If the site does not exist but can be created, you will see a green box and the text &amp;quot;This SharePoint site will be created by Moodle and used for Moodle content.&amp;quot;. This SharePoint site will be created by Moodle during initialization.&lt;br /&gt;
# Click &#039;&#039;&#039;Save changes&#039;&#039;&#039; at the bottom of the settings page.&lt;br /&gt;
# You will see a spinning icon below the SharePoint Link setting, and the text &amp;quot;Moodle is setting up this SharePoint site.&amp;quot;. &#039;&#039;&#039;This will not automatically update - refresh the page to check if the connection has been set up.&#039;&#039;&#039;.&lt;br /&gt;
# The SharePoint Link is set up during the Moodle cron, so ensure your Moodle cron is set up and running.&lt;br /&gt;
&lt;br /&gt;
====Preview features====&lt;br /&gt;
=====Enable preview features=====&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in Team linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
==How will cookie changes in Chrome version 80 affect Teams integration?==&lt;br /&gt;
The stable release of the Google Chrome web browser (build 80, scheduled for release on February 4, 2020) features a change in how cookies are handled. This will include two changes:&lt;br /&gt;
* Cookies without a &#039;&#039;&#039;SameSite&#039;&#039;&#039; attribute will be treated as SameSite=Lax.&lt;br /&gt;
* Cookies with &#039;&#039;&#039;SameSite=None&#039;&#039;&#039; must also specify &#039;&#039;&#039;Secure&#039;&#039;&#039;, meaning they require a secure context.&lt;br /&gt;
The changes are explained in [https://web.dev/samesite-cookies-explained/ here] and [https://blog.chromium.org/2019/10/developers-get-ready-for-new.html here]&lt;br /&gt;
&lt;br /&gt;
Moodle and Microsoft Teams integration will be affected by this change, because the integration requires embedding Moodle pages in Teams. There is [https://tracker.moodle.org/browse/MDL-67175 an open item] in Moodle tracker about this change in general, but the code change proposed in the tracker item didn&#039;t get integrated in time for the last minor Moodle upgrade before Chrome 80 release date. As a result, all sites using Moodle and Microsoft Teams integration feature are strongly suggested to apply the patches proposed in the [https://tracker.moodle.org/browse/MDL-67175 tracker item] so that users with Chrome 80 can keep using Moodle tabs in Teams after upgrade.&lt;br /&gt;
* Patches are provided for all Moodle versions that are supported for core feature and security issues, i.e. 3.5, 3.6, 3.7 and 3.8.&lt;br /&gt;
* Patches are only required before this is integrated into the next Moodle minor release of the Moodle versions, which is scheduled at March 9th, 2020.&lt;br /&gt;
* After the next Moodle minor release, the patch should be removed as it would be integration into core Moodle code.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138594</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138594"/>
		<updated>2020-09-28T15:29:17Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* Configure application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections according to the table below.&lt;br /&gt;
## After all the permissions are added, click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;10&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Maintain access to data you have given it access to&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; email address&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;View users&#039; basic profile&#039;&#039;&#039;&lt;br /&gt;
| Required for Teams SSO.&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
&lt;br /&gt;
==== Create accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
&lt;br /&gt;
==== Update all accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
&lt;br /&gt;
==== Delete previously synced accounts in Moodle when they are deleted from Azure AD ====&lt;br /&gt;
This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
&lt;br /&gt;
==== Match preexisting Moodle users with same-named accounts in Azure AD ====&lt;br /&gt;
This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are case-insentitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
&lt;br /&gt;
==== Switch matched users to Office 365 (OpenID Connect) authentication ====&lt;br /&gt;
This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
&lt;br /&gt;
==== Assign users to application during sync ====&lt;br /&gt;
&lt;br /&gt;
The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle in cron job ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle on login ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
&lt;br /&gt;
==== Perform a full sync each run ====&lt;br /&gt;
&lt;br /&gt;
By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
&lt;br /&gt;
==== Match Azure usernames to moodle emails instead of moodle usernames during the sync ====&lt;br /&gt;
&lt;br /&gt;
Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third colum on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
====Tenants====&lt;br /&gt;
This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
&lt;br /&gt;
====Health Check====&lt;br /&gt;
If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
&lt;br /&gt;
====User Matching====&lt;br /&gt;
This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user.&lt;br /&gt;
&lt;br /&gt;
Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
&lt;br /&gt;
====Maintenance Tools====&lt;br /&gt;
These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
&lt;br /&gt;
=====Resync users in groups for courses=====&lt;br /&gt;
Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
&lt;br /&gt;
=====Recreate deleted Office 365 groups=====&lt;br /&gt;
Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
&lt;br /&gt;
=====Generate debug data package=====&lt;br /&gt;
This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
&lt;br /&gt;
=====Cleanup OpenID Connect Tokens=====&lt;br /&gt;
If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors.&lt;br /&gt;
&lt;br /&gt;
====Advanced settings====&lt;br /&gt;
=====Office 365 for China=====&lt;br /&gt;
Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
=====Record debug messages=====&lt;br /&gt;
If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
=====Minimum inexact username length to switch to Office 365=====&lt;br /&gt;
When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
=====Profile photo refresh time=====&lt;br /&gt;
Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
&lt;br /&gt;
====Legacy settings====&lt;br /&gt;
===== SharePoint Link =====&lt;br /&gt;
&#039;&#039;&#039;This feature is deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SharePoint sites can be created for each course on your Moodle site. You will provide a parent SharePoint site and subsites for each course will be automatically created. The document library for each of these subsites can then be accessed by teachers using the OneDrive for Business repository. This provides a shared store of files for a course, allowing teachers to collaborate on documents and share resources.&lt;br /&gt;
&lt;br /&gt;
* Any AzureAD-connected Moodle user with the &#039;&#039;&#039;moodle/course:managefiles&#039;&#039;&#039; capability in a course will be able to access the document library from the repository.&lt;br /&gt;
&lt;br /&gt;
====== Setting up the SharePoint connection ======&lt;br /&gt;
# Visit the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration).&lt;br /&gt;
# Under the &#039;&#039;&#039;Options&#039;&#039;&#039; tab, look for the &#039;&#039;&#039;SharePoint Link&#039;&#039;&#039; setting.&lt;br /&gt;
# Type in the URL of the parent SharePoint site you&#039;d like to use for the course subsites.&lt;br /&gt;
## This should be the entire URL to the SharePoint site - for example: &#039;&#039;&#039;https://contoso.sharepoint.com/moodle&#039;&#039;&#039;.&lt;br /&gt;
## This site must be accessible to the &#039;&#039;&#039;System API user&#039;&#039;&#039;&lt;br /&gt;
# When you are done typing in the URL, the URL will be checked for suitability.&lt;br /&gt;
## If the valid is invalid, you will see a red box and the text &amp;quot;This is not a usable SharePoint site.&amp;quot;&lt;br /&gt;
## If the site already exists, you will see a blue box and the text &amp;quot;This site is usable, but already exists&amp;quot;. You can use this site, but conflicts can arise. It&#039;s recommended to use a URL to a SharePoint site that doesn&#039;t yet exist. The site will be created during initialization.&lt;br /&gt;
## If the site does not exist but can be created, you will see a green box and the text &amp;quot;This SharePoint site will be created by Moodle and used for Moodle content.&amp;quot;. This SharePoint site will be created by Moodle during initialization.&lt;br /&gt;
# Click &#039;&#039;&#039;Save changes&#039;&#039;&#039; at the bottom of the settings page.&lt;br /&gt;
# You will see a spinning icon below the SharePoint Link setting, and the text &amp;quot;Moodle is setting up this SharePoint site.&amp;quot;. &#039;&#039;&#039;This will not automatically update - refresh the page to check if the connection has been set up.&#039;&#039;&#039;.&lt;br /&gt;
# The SharePoint Link is set up during the Moodle cron, so ensure your Moodle cron is set up and running.&lt;br /&gt;
&lt;br /&gt;
====Preview features====&lt;br /&gt;
=====Enable preview features=====&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in Team linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
==How will cookie changes in Chrome version 80 affect Teams integration?==&lt;br /&gt;
The stable release of the Google Chrome web browser (build 80, scheduled for release on February 4, 2020) features a change in how cookies are handled. This will include two changes:&lt;br /&gt;
* Cookies without a &#039;&#039;&#039;SameSite&#039;&#039;&#039; attribute will be treated as SameSite=Lax.&lt;br /&gt;
* Cookies with &#039;&#039;&#039;SameSite=None&#039;&#039;&#039; must also specify &#039;&#039;&#039;Secure&#039;&#039;&#039;, meaning they require a secure context.&lt;br /&gt;
The changes are explained in [https://web.dev/samesite-cookies-explained/ here] and [https://blog.chromium.org/2019/10/developers-get-ready-for-new.html here]&lt;br /&gt;
&lt;br /&gt;
Moodle and Microsoft Teams integration will be affected by this change, because the integration requires embedding Moodle pages in Teams. There is [https://tracker.moodle.org/browse/MDL-67175 an open item] in Moodle tracker about this change in general, but the code change proposed in the tracker item didn&#039;t get integrated in time for the last minor Moodle upgrade before Chrome 80 release date. As a result, all sites using Moodle and Microsoft Teams integration feature are strongly suggested to apply the patches proposed in the [https://tracker.moodle.org/browse/MDL-67175 tracker item] so that users with Chrome 80 can keep using Moodle tabs in Teams after upgrade.&lt;br /&gt;
* Patches are provided for all Moodle versions that are supported for core feature and security issues, i.e. 3.5, 3.6, 3.7 and 3.8.&lt;br /&gt;
* Patches are only required before this is integrated into the next Moodle minor release of the Moodle versions, which is scheduled at March 9th, 2020.&lt;br /&gt;
* After the next Moodle minor release, the patch should be removed as it would be integration into core Moodle code.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138593</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138593"/>
		<updated>2020-09-28T15:27:02Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* Add a user to the app */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections: &lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;10&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| Maintain access to data you have given it access to&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| View users&#039; email address&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| View users&#039; basic profile&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
## Click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
&lt;br /&gt;
==== Create accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
&lt;br /&gt;
==== Update all accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
&lt;br /&gt;
==== Delete previously synced accounts in Moodle when they are deleted from Azure AD ====&lt;br /&gt;
This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
&lt;br /&gt;
==== Match preexisting Moodle users with same-named accounts in Azure AD ====&lt;br /&gt;
This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are case-insentitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
&lt;br /&gt;
==== Switch matched users to Office 365 (OpenID Connect) authentication ====&lt;br /&gt;
This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
&lt;br /&gt;
==== Assign users to application during sync ====&lt;br /&gt;
&lt;br /&gt;
The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle in cron job ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle on login ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
&lt;br /&gt;
==== Perform a full sync each run ====&lt;br /&gt;
&lt;br /&gt;
By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
&lt;br /&gt;
==== Match Azure usernames to moodle emails instead of moodle usernames during the sync ====&lt;br /&gt;
&lt;br /&gt;
Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third colum on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
====Tenants====&lt;br /&gt;
This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
&lt;br /&gt;
====Health Check====&lt;br /&gt;
If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
&lt;br /&gt;
====User Matching====&lt;br /&gt;
This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user.&lt;br /&gt;
&lt;br /&gt;
Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
&lt;br /&gt;
====Maintenance Tools====&lt;br /&gt;
These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
&lt;br /&gt;
=====Resync users in groups for courses=====&lt;br /&gt;
Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
&lt;br /&gt;
=====Recreate deleted Office 365 groups=====&lt;br /&gt;
Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
&lt;br /&gt;
=====Generate debug data package=====&lt;br /&gt;
This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
&lt;br /&gt;
=====Cleanup OpenID Connect Tokens=====&lt;br /&gt;
If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors.&lt;br /&gt;
&lt;br /&gt;
====Advanced settings====&lt;br /&gt;
=====Office 365 for China=====&lt;br /&gt;
Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
=====Record debug messages=====&lt;br /&gt;
If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
=====Minimum inexact username length to switch to Office 365=====&lt;br /&gt;
When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
=====Profile photo refresh time=====&lt;br /&gt;
Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
&lt;br /&gt;
====Legacy settings====&lt;br /&gt;
===== SharePoint Link =====&lt;br /&gt;
&#039;&#039;&#039;This feature is deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SharePoint sites can be created for each course on your Moodle site. You will provide a parent SharePoint site and subsites for each course will be automatically created. The document library for each of these subsites can then be accessed by teachers using the OneDrive for Business repository. This provides a shared store of files for a course, allowing teachers to collaborate on documents and share resources.&lt;br /&gt;
&lt;br /&gt;
* Any AzureAD-connected Moodle user with the &#039;&#039;&#039;moodle/course:managefiles&#039;&#039;&#039; capability in a course will be able to access the document library from the repository.&lt;br /&gt;
&lt;br /&gt;
====== Setting up the SharePoint connection ======&lt;br /&gt;
# Visit the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration).&lt;br /&gt;
# Under the &#039;&#039;&#039;Options&#039;&#039;&#039; tab, look for the &#039;&#039;&#039;SharePoint Link&#039;&#039;&#039; setting.&lt;br /&gt;
# Type in the URL of the parent SharePoint site you&#039;d like to use for the course subsites.&lt;br /&gt;
## This should be the entire URL to the SharePoint site - for example: &#039;&#039;&#039;https://contoso.sharepoint.com/moodle&#039;&#039;&#039;.&lt;br /&gt;
## This site must be accessible to the &#039;&#039;&#039;System API user&#039;&#039;&#039;&lt;br /&gt;
# When you are done typing in the URL, the URL will be checked for suitability.&lt;br /&gt;
## If the valid is invalid, you will see a red box and the text &amp;quot;This is not a usable SharePoint site.&amp;quot;&lt;br /&gt;
## If the site already exists, you will see a blue box and the text &amp;quot;This site is usable, but already exists&amp;quot;. You can use this site, but conflicts can arise. It&#039;s recommended to use a URL to a SharePoint site that doesn&#039;t yet exist. The site will be created during initialization.&lt;br /&gt;
## If the site does not exist but can be created, you will see a green box and the text &amp;quot;This SharePoint site will be created by Moodle and used for Moodle content.&amp;quot;. This SharePoint site will be created by Moodle during initialization.&lt;br /&gt;
# Click &#039;&#039;&#039;Save changes&#039;&#039;&#039; at the bottom of the settings page.&lt;br /&gt;
# You will see a spinning icon below the SharePoint Link setting, and the text &amp;quot;Moodle is setting up this SharePoint site.&amp;quot;. &#039;&#039;&#039;This will not automatically update - refresh the page to check if the connection has been set up.&#039;&#039;&#039;.&lt;br /&gt;
# The SharePoint Link is set up during the Moodle cron, so ensure your Moodle cron is set up and running.&lt;br /&gt;
&lt;br /&gt;
====Preview features====&lt;br /&gt;
=====Enable preview features=====&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in Team linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
==How will cookie changes in Chrome version 80 affect Teams integration?==&lt;br /&gt;
The stable release of the Google Chrome web browser (build 80, scheduled for release on February 4, 2020) features a change in how cookies are handled. This will include two changes:&lt;br /&gt;
* Cookies without a &#039;&#039;&#039;SameSite&#039;&#039;&#039; attribute will be treated as SameSite=Lax.&lt;br /&gt;
* Cookies with &#039;&#039;&#039;SameSite=None&#039;&#039;&#039; must also specify &#039;&#039;&#039;Secure&#039;&#039;&#039;, meaning they require a secure context.&lt;br /&gt;
The changes are explained in [https://web.dev/samesite-cookies-explained/ here] and [https://blog.chromium.org/2019/10/developers-get-ready-for-new.html here]&lt;br /&gt;
&lt;br /&gt;
Moodle and Microsoft Teams integration will be affected by this change, because the integration requires embedding Moodle pages in Teams. There is [https://tracker.moodle.org/browse/MDL-67175 an open item] in Moodle tracker about this change in general, but the code change proposed in the tracker item didn&#039;t get integrated in time for the last minor Moodle upgrade before Chrome 80 release date. As a result, all sites using Moodle and Microsoft Teams integration feature are strongly suggested to apply the patches proposed in the [https://tracker.moodle.org/browse/MDL-67175 tracker item] so that users with Chrome 80 can keep using Moodle tabs in Teams after upgrade.&lt;br /&gt;
* Patches are provided for all Moodle versions that are supported for core feature and security issues, i.e. 3.5, 3.6, 3.7 and 3.8.&lt;br /&gt;
* Patches are only required before this is integrated into the next Moodle minor release of the Moodle versions, which is scheduled at March 9th, 2020.&lt;br /&gt;
* After the next Moodle minor release, the patch should be removed as it would be integration into core Moodle code.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138592</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138592"/>
		<updated>2020-09-28T15:26:36Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up].&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must configure Microsoft Azure to manage your Office 365 Microsoft Azure Active Directory. A guide is available at [https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant this link].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script, or you need to verify some specific settings.&lt;br /&gt;
&lt;br /&gt;
==== Manual steps ====&lt;br /&gt;
The following steps are involved in the manual setup:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New registration&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section. Note that if you choose option other than the &amp;quot;single tenant&amp;quot; one for &amp;quot;Who can use this application or access this API?&amp;quot;, you will not be able to use SSO in Teams integration.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
===== Configure application =====&lt;br /&gt;
# Locate the App.&lt;br /&gt;
## Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
## Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
## Click on the App you created for Moodle. Note you may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot; if the App was not created by you.&lt;br /&gt;
## Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
## Click on the display name of the App to open its settings.&lt;br /&gt;
# Enable implicit grant flow.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## In the &#039;&#039;&#039;Implicit grant&#039;&#039;&#039; section, check both &amp;quot;Access tokens&amp;quot; and &amp;quot;ID tokens&amp;quot;.&lt;br /&gt;
## Save the changes.&lt;br /&gt;
# Create client secrets.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Expose an API - only required if Teams sync feature is used.&lt;br /&gt;
## From the menu on the left, go to &#039;&#039;&#039;Expose an API&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click the &amp;quot;Set&amp;quot; link next to &amp;quot;Application ID URI&amp;quot;.&lt;br /&gt;
## This should open a &amp;quot;Set the APP ID URI&amp;quot; prompt, with a default value such as &amp;quot;api://00000000-0000-0000-0000-000000000000&amp;quot;, where the GUID is the same as your Application ID.&lt;br /&gt;
## Replace this value with &amp;quot;api://URL.TO.MOODLE/00000000-0000-0000-0000-000000000000&amp;quot;, where URL.TO.MOODLE is the wwwroot of your Moodle site, and the GUID is the same was default value, i.e. your Application ID.&lt;br /&gt;
## Click &amp;quot;Save&amp;quot; to create the Application ID URI.&lt;br /&gt;
## Click &amp;quot;Add a scope&amp;quot;.&lt;br /&gt;
## Enter &amp;quot;access_as_user&amp;quot; as scope name.&lt;br /&gt;
## Set &amp;quot;Who can consent?&amp;quot; to &amp;quot;Admins and users&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent title&amp;quot; to &amp;quot;Teams can access the user’s profile&amp;quot;.&lt;br /&gt;
## Set &amp;quot;Admin consent description&amp;quot; to &amp;quot;Allows Teams to call the app’s web APIs as the current user&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent title&amp;quot; to &amp;quot;Teams can access the user profile and make requests on the user&#039;s behalf&amp;quot;.&lt;br /&gt;
## Set &amp;quot;User consent description&amp;quot; to &amp;quot;Enable Teams to call this app’s APIs with the same rights as the user&amp;quot;&lt;br /&gt;
## Ensure that &amp;quot;State&amp;quot; is set to &amp;quot;Enabled&amp;quot;.&lt;br /&gt;
## Select the &amp;quot;Add scope&amp;quot; button to save.&lt;br /&gt;
## In the &amp;quot;Authorized client applications&amp;quot; section, identify the applications that you want to authorize for your app’s web application. Select Add a client application. Enter each of the following client IDs and select the authorized scope you created in the previous step:&lt;br /&gt;
### 1fec8e78-bce4-4aaf-ab1b-5451cc387264 (Teams mobile/desktop application)&lt;br /&gt;
### 5e3ce6c0-2b1f-4285-8d4b-75ee78787346 (Teams web application)&lt;br /&gt;
# Configure App Permissions.&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039; tab, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections: &lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;10&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;offline_access&#039;&#039;&#039;&lt;br /&gt;
| Maintain access to data you have given it access to&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;email&#039;&#039;&#039;&lt;br /&gt;
| View users&#039; email address&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;profile&#039;&#039;&#039;&lt;br /&gt;
| View users&#039; basic profile&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
## Click the &amp;quot;Grant admin consent for YOUR ORGANISATION NAME&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
===== Add a user to the app =====&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section.&lt;br /&gt;
# Click on the &#039;&#039;&#039;Enterprise applications&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click on the App you created for Moodle. Note this page lists all applications of all types, so make sure the right one is chosen in case there are applications with duplicate names.&lt;br /&gt;
# Click &#039;&#039;&#039;Users and groups&#039;&#039;&#039; under the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
# Add users to your application using the &#039;&#039;&#039;Add user&#039;&#039;&#039; button. Eventually all users who need to access Moodle from Office365 need to be added here. If the amount of users is large, they can be put into a group and added together.&lt;br /&gt;
&lt;br /&gt;
The application will appear in the [https://portal.office.com/myapps My apps] page of the application launcher on the o365 portal for the users which have been assigned.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
&lt;br /&gt;
==== Create accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
&lt;br /&gt;
==== Update all accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
&lt;br /&gt;
==== Delete previously synced accounts in Moodle when they are deleted from Azure AD ====&lt;br /&gt;
This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
&lt;br /&gt;
==== Match preexisting Moodle users with same-named accounts in Azure AD ====&lt;br /&gt;
This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are case-insentitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
&lt;br /&gt;
==== Switch matched users to Office 365 (OpenID Connect) authentication ====&lt;br /&gt;
This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
&lt;br /&gt;
==== Assign users to application during sync ====&lt;br /&gt;
&lt;br /&gt;
The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle in cron job ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle on login ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
&lt;br /&gt;
==== Perform a full sync each run ====&lt;br /&gt;
&lt;br /&gt;
By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
&lt;br /&gt;
==== Match Azure usernames to moodle emails instead of moodle usernames during the sync ====&lt;br /&gt;
&lt;br /&gt;
Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third colum on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
====Tenants====&lt;br /&gt;
This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
&lt;br /&gt;
====Health Check====&lt;br /&gt;
If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
&lt;br /&gt;
====User Matching====&lt;br /&gt;
This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user.&lt;br /&gt;
&lt;br /&gt;
Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
&lt;br /&gt;
====Maintenance Tools====&lt;br /&gt;
These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
&lt;br /&gt;
=====Resync users in groups for courses=====&lt;br /&gt;
Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
&lt;br /&gt;
=====Recreate deleted Office 365 groups=====&lt;br /&gt;
Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
&lt;br /&gt;
=====Generate debug data package=====&lt;br /&gt;
This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
&lt;br /&gt;
=====Cleanup OpenID Connect Tokens=====&lt;br /&gt;
If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors.&lt;br /&gt;
&lt;br /&gt;
====Advanced settings====&lt;br /&gt;
=====Office 365 for China=====&lt;br /&gt;
Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
=====Record debug messages=====&lt;br /&gt;
If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
=====Minimum inexact username length to switch to Office 365=====&lt;br /&gt;
When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
=====Profile photo refresh time=====&lt;br /&gt;
Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
&lt;br /&gt;
====Legacy settings====&lt;br /&gt;
===== SharePoint Link =====&lt;br /&gt;
&#039;&#039;&#039;This feature is deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SharePoint sites can be created for each course on your Moodle site. You will provide a parent SharePoint site and subsites for each course will be automatically created. The document library for each of these subsites can then be accessed by teachers using the OneDrive for Business repository. This provides a shared store of files for a course, allowing teachers to collaborate on documents and share resources.&lt;br /&gt;
&lt;br /&gt;
* Any AzureAD-connected Moodle user with the &#039;&#039;&#039;moodle/course:managefiles&#039;&#039;&#039; capability in a course will be able to access the document library from the repository.&lt;br /&gt;
&lt;br /&gt;
====== Setting up the SharePoint connection ======&lt;br /&gt;
# Visit the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration).&lt;br /&gt;
# Under the &#039;&#039;&#039;Options&#039;&#039;&#039; tab, look for the &#039;&#039;&#039;SharePoint Link&#039;&#039;&#039; setting.&lt;br /&gt;
# Type in the URL of the parent SharePoint site you&#039;d like to use for the course subsites.&lt;br /&gt;
## This should be the entire URL to the SharePoint site - for example: &#039;&#039;&#039;https://contoso.sharepoint.com/moodle&#039;&#039;&#039;.&lt;br /&gt;
## This site must be accessible to the &#039;&#039;&#039;System API user&#039;&#039;&#039;&lt;br /&gt;
# When you are done typing in the URL, the URL will be checked for suitability.&lt;br /&gt;
## If the valid is invalid, you will see a red box and the text &amp;quot;This is not a usable SharePoint site.&amp;quot;&lt;br /&gt;
## If the site already exists, you will see a blue box and the text &amp;quot;This site is usable, but already exists&amp;quot;. You can use this site, but conflicts can arise. It&#039;s recommended to use a URL to a SharePoint site that doesn&#039;t yet exist. The site will be created during initialization.&lt;br /&gt;
## If the site does not exist but can be created, you will see a green box and the text &amp;quot;This SharePoint site will be created by Moodle and used for Moodle content.&amp;quot;. This SharePoint site will be created by Moodle during initialization.&lt;br /&gt;
# Click &#039;&#039;&#039;Save changes&#039;&#039;&#039; at the bottom of the settings page.&lt;br /&gt;
# You will see a spinning icon below the SharePoint Link setting, and the text &amp;quot;Moodle is setting up this SharePoint site.&amp;quot;. &#039;&#039;&#039;This will not automatically update - refresh the page to check if the connection has been set up.&#039;&#039;&#039;.&lt;br /&gt;
# The SharePoint Link is set up during the Moodle cron, so ensure your Moodle cron is set up and running.&lt;br /&gt;
&lt;br /&gt;
====Preview features====&lt;br /&gt;
=====Enable preview features=====&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in Team linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
==How will cookie changes in Chrome version 80 affect Teams integration?==&lt;br /&gt;
The stable release of the Google Chrome web browser (build 80, scheduled for release on February 4, 2020) features a change in how cookies are handled. This will include two changes:&lt;br /&gt;
* Cookies without a &#039;&#039;&#039;SameSite&#039;&#039;&#039; attribute will be treated as SameSite=Lax.&lt;br /&gt;
* Cookies with &#039;&#039;&#039;SameSite=None&#039;&#039;&#039; must also specify &#039;&#039;&#039;Secure&#039;&#039;&#039;, meaning they require a secure context.&lt;br /&gt;
The changes are explained in [https://web.dev/samesite-cookies-explained/ here] and [https://blog.chromium.org/2019/10/developers-get-ready-for-new.html here]&lt;br /&gt;
&lt;br /&gt;
Moodle and Microsoft Teams integration will be affected by this change, because the integration requires embedding Moodle pages in Teams. There is [https://tracker.moodle.org/browse/MDL-67175 an open item] in Moodle tracker about this change in general, but the code change proposed in the tracker item didn&#039;t get integrated in time for the last minor Moodle upgrade before Chrome 80 release date. As a result, all sites using Moodle and Microsoft Teams integration feature are strongly suggested to apply the patches proposed in the [https://tracker.moodle.org/browse/MDL-67175 tracker item] so that users with Chrome 80 can keep using Moodle tabs in Teams after upgrade.&lt;br /&gt;
* Patches are provided for all Moodle versions that are supported for core feature and security issues, i.e. 3.5, 3.6, 3.7 and 3.8.&lt;br /&gt;
* Patches are only required before this is integrated into the next Moodle minor release of the Moodle versions, which is scheduled at March 9th, 2020.&lt;br /&gt;
* After the next Moodle minor release, the patch should be removed as it would be integration into core Moodle code.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138591</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138591"/>
		<updated>2020-09-28T14:42:32Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* Plugins &amp;amp; Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 4 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. It provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Teams&lt;br /&gt;
**** Teams can be automatically created for each course in Moodle (or you can select which courses are used), and Team membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by Teams.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Azure AD login preferences, Calendar sync preferences, OneNote notebooks, Teams, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 4 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Teams Theme&#039;&#039;&#039; (theme_boost_o365teams)&lt;br /&gt;
** This provides a theme to be used when when opening the course page in Teams tab, and provides a seamless user experience for users in Teams.&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have a user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [[http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up]]&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must [https://manage.windowsazure.com configure Microsoft Azure] to manage your Office 365 Microsoft Azure Active Directory:&lt;br /&gt;
# Create a new Active Directory.&lt;br /&gt;
# Select Use existing directory.&lt;br /&gt;
# Select &#039;&#039;&#039;I am ready to be signed out now&#039;&#039;&#039; and click the check mark.&lt;br /&gt;
# Sign in with your Office 365 subscription credentials.&lt;br /&gt;
# Click &#039;&#039;&#039;Continue&#039;&#039;&#039;.&lt;br /&gt;
# Log out and sign back in to your Azure account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab. You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script.&lt;br /&gt;
&lt;br /&gt;
The manual steps are:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
=== Configure application ===&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click on the App you created for Moodle.&lt;br /&gt;
## You may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot;&lt;br /&gt;
# Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
# Click on the display name of the App to open its settings.&lt;br /&gt;
# From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
# Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Configure &#039;&#039;&#039;Azure Activity Directory Graph&#039;&#039;&#039; Permissions&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039;, then choose &#039;&#039;&#039;Azure Active Directory Graph&#039;&#039;&#039; from &#039;&#039;&#039;Supported legacy APIs&#039;&#039;&#039; section.&lt;br /&gt;
## Click the checkbox for &#039;&#039;&#039;User.Read&#039;&#039;&#039; permissions in each of the &amp;quot;Delegated&amp;quot; permissions sections.&lt;br /&gt;
# Configure &#039;&#039;&#039;Microsoft Graph&#039;&#039;&#039; Permissions&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039;, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections: &lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;10&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Add a user to the app ===&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section.&lt;br /&gt;
# Click on the &#039;&#039;&#039;Enterprise applications&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click on the App you created for Moodle. Note this page lists all applications of all types, so make sure the right one is chosen in case there are applications with duplicate names.&lt;br /&gt;
# Click &#039;&#039;&#039;Users and groups&#039;&#039;&#039; under the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
# Add users to your application using the &#039;&#039;&#039;Add user&#039;&#039;&#039; button. Eventually all users who need to access Moodle from Office365 need to be added here. If the amount of users is large, they can be put into a group and added together.&lt;br /&gt;
&lt;br /&gt;
The application will appear in the [https://portal.office.com/myapps My apps] page of the application launcher on the o365 portal for the users which have been assigned.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
&lt;br /&gt;
==== Create accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
&lt;br /&gt;
==== Update all accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
&lt;br /&gt;
==== Delete previously synced accounts in Moodle when they are deleted from Azure AD ====&lt;br /&gt;
This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
&lt;br /&gt;
==== Match preexisting Moodle users with same-named accounts in Azure AD ====&lt;br /&gt;
This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are case-insentitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
&lt;br /&gt;
==== Switch matched users to Office 365 (OpenID Connect) authentication ====&lt;br /&gt;
This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
&lt;br /&gt;
==== Assign users to application during sync ====&lt;br /&gt;
&lt;br /&gt;
The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle in cron job ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle on login ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
&lt;br /&gt;
==== Perform a full sync each run ====&lt;br /&gt;
&lt;br /&gt;
By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
&lt;br /&gt;
==== Match Azure usernames to moodle emails instead of moodle usernames during the sync ====&lt;br /&gt;
&lt;br /&gt;
Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third colum on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
====Tenants====&lt;br /&gt;
This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
&lt;br /&gt;
====Health Check====&lt;br /&gt;
If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
&lt;br /&gt;
====User Matching====&lt;br /&gt;
This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user.&lt;br /&gt;
&lt;br /&gt;
Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
&lt;br /&gt;
====Maintenance Tools====&lt;br /&gt;
These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
&lt;br /&gt;
=====Resync users in groups for courses=====&lt;br /&gt;
Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
&lt;br /&gt;
=====Recreate deleted Office 365 groups=====&lt;br /&gt;
Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
&lt;br /&gt;
=====Generate debug data package=====&lt;br /&gt;
This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
&lt;br /&gt;
=====Cleanup OpenID Connect Tokens=====&lt;br /&gt;
If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors.&lt;br /&gt;
&lt;br /&gt;
====Advanced settings====&lt;br /&gt;
=====Office 365 for China=====&lt;br /&gt;
Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
=====Record debug messages=====&lt;br /&gt;
If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
=====Minimum inexact username length to switch to Office 365=====&lt;br /&gt;
When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
=====Profile photo refresh time=====&lt;br /&gt;
Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
&lt;br /&gt;
====Legacy settings====&lt;br /&gt;
===== SharePoint Link =====&lt;br /&gt;
&#039;&#039;&#039;This feature is deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SharePoint sites can be created for each course on your Moodle site. You will provide a parent SharePoint site and subsites for each course will be automatically created. The document library for each of these subsites can then be accessed by teachers using the OneDrive for Business repository. This provides a shared store of files for a course, allowing teachers to collaborate on documents and share resources.&lt;br /&gt;
&lt;br /&gt;
* Any AzureAD-connected Moodle user with the &#039;&#039;&#039;moodle/course:managefiles&#039;&#039;&#039; capability in a course will be able to access the document library from the repository.&lt;br /&gt;
&lt;br /&gt;
====== Setting up the SharePoint connection ======&lt;br /&gt;
# Visit the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration).&lt;br /&gt;
# Under the &#039;&#039;&#039;Options&#039;&#039;&#039; tab, look for the &#039;&#039;&#039;SharePoint Link&#039;&#039;&#039; setting.&lt;br /&gt;
# Type in the URL of the parent SharePoint site you&#039;d like to use for the course subsites.&lt;br /&gt;
## This should be the entire URL to the SharePoint site - for example: &#039;&#039;&#039;https://contoso.sharepoint.com/moodle&#039;&#039;&#039;.&lt;br /&gt;
## This site must be accessible to the &#039;&#039;&#039;System API user&#039;&#039;&#039;&lt;br /&gt;
# When you are done typing in the URL, the URL will be checked for suitability.&lt;br /&gt;
## If the valid is invalid, you will see a red box and the text &amp;quot;This is not a usable SharePoint site.&amp;quot;&lt;br /&gt;
## If the site already exists, you will see a blue box and the text &amp;quot;This site is usable, but already exists&amp;quot;. You can use this site, but conflicts can arise. It&#039;s recommended to use a URL to a SharePoint site that doesn&#039;t yet exist. The site will be created during initialization.&lt;br /&gt;
## If the site does not exist but can be created, you will see a green box and the text &amp;quot;This SharePoint site will be created by Moodle and used for Moodle content.&amp;quot;. This SharePoint site will be created by Moodle during initialization.&lt;br /&gt;
# Click &#039;&#039;&#039;Save changes&#039;&#039;&#039; at the bottom of the settings page.&lt;br /&gt;
# You will see a spinning icon below the SharePoint Link setting, and the text &amp;quot;Moodle is setting up this SharePoint site.&amp;quot;. &#039;&#039;&#039;This will not automatically update - refresh the page to check if the connection has been set up.&#039;&#039;&#039;.&lt;br /&gt;
# The SharePoint Link is set up during the Moodle cron, so ensure your Moodle cron is set up and running.&lt;br /&gt;
&lt;br /&gt;
====Preview features====&lt;br /&gt;
=====Enable preview features=====&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in Team linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
==How will cookie changes in Chrome version 80 affect Teams integration?==&lt;br /&gt;
The stable release of the Google Chrome web browser (build 80, scheduled for release on February 4, 2020) features a change in how cookies are handled. This will include two changes:&lt;br /&gt;
* Cookies without a &#039;&#039;&#039;SameSite&#039;&#039;&#039; attribute will be treated as SameSite=Lax.&lt;br /&gt;
* Cookies with &#039;&#039;&#039;SameSite=None&#039;&#039;&#039; must also specify &#039;&#039;&#039;Secure&#039;&#039;&#039;, meaning they require a secure context.&lt;br /&gt;
The changes are explained in [https://web.dev/samesite-cookies-explained/ here] and [https://blog.chromium.org/2019/10/developers-get-ready-for-new.html here]&lt;br /&gt;
&lt;br /&gt;
Moodle and Microsoft Teams integration will be affected by this change, because the integration requires embedding Moodle pages in Teams. There is [https://tracker.moodle.org/browse/MDL-67175 an open item] in Moodle tracker about this change in general, but the code change proposed in the tracker item didn&#039;t get integrated in time for the last minor Moodle upgrade before Chrome 80 release date. As a result, all sites using Moodle and Microsoft Teams integration feature are strongly suggested to apply the patches proposed in the [https://tracker.moodle.org/browse/MDL-67175 tracker item] so that users with Chrome 80 can keep using Moodle tabs in Teams after upgrade.&lt;br /&gt;
* Patches are provided for all Moodle versions that are supported for core feature and security issues, i.e. 3.5, 3.6, 3.7 and 3.8.&lt;br /&gt;
* Patches are only required before this is integrated into the next Moodle minor release of the Moodle versions, which is scheduled at March 9th, 2020.&lt;br /&gt;
* After the next Moodle minor release, the patch should be removed as it would be integration into core Moodle code.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138590</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138590"/>
		<updated>2020-09-28T14:36:34Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.5 or above. The plugins are available for Moodle versions 2.7 are above. Features available in each version, and the support status vary.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 3 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. This provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Course Groups&lt;br /&gt;
**** Office 365 groups can be automatically created for each course in Moodle (or you can select which courses are used), and group membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by course groups.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Course SharePoint sites, Azure AD login preferences, Calendar sync preferences, OneNote notebooks, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 3 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have an user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [[http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up]]&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must [https://manage.windowsazure.com configure Microsoft Azure] to manage your Office 365 Microsoft Azure Active Directory:&lt;br /&gt;
# Create a new Active Directory.&lt;br /&gt;
# Select Use existing directory.&lt;br /&gt;
# Select &#039;&#039;&#039;I am ready to be signed out now&#039;&#039;&#039; and click the check mark.&lt;br /&gt;
# Sign in with your Office 365 subscription credentials.&lt;br /&gt;
# Click &#039;&#039;&#039;Continue&#039;&#039;&#039;.&lt;br /&gt;
# Log out and sign back in to your Azure account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab. You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script.&lt;br /&gt;
&lt;br /&gt;
The manual steps are:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
=== Configure application ===&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click on the App you created for Moodle.&lt;br /&gt;
## You may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot;&lt;br /&gt;
# Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
# Click on the display name of the App to open its settings.&lt;br /&gt;
# From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
# Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Configure &#039;&#039;&#039;Azure Activity Directory Graph&#039;&#039;&#039; Permissions&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039;, then choose &#039;&#039;&#039;Azure Active Directory Graph&#039;&#039;&#039; from &#039;&#039;&#039;Supported legacy APIs&#039;&#039;&#039; section.&lt;br /&gt;
## Click the checkbox for &#039;&#039;&#039;User.Read&#039;&#039;&#039; permissions in each of the &amp;quot;Delegated&amp;quot; permissions sections.&lt;br /&gt;
# Configure &#039;&#039;&#039;Microsoft Graph&#039;&#039;&#039; Permissions&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039;, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections: &lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;10&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Add a user to the app ===&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section.&lt;br /&gt;
# Click on the &#039;&#039;&#039;Enterprise applications&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click on the App you created for Moodle. Note this page lists all applications of all types, so make sure the right one is chosen in case there are applications with duplicate names.&lt;br /&gt;
# Click &#039;&#039;&#039;Users and groups&#039;&#039;&#039; under the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
# Add users to your application using the &#039;&#039;&#039;Add user&#039;&#039;&#039; button. Eventually all users who need to access Moodle from Office365 need to be added here. If the amount of users is large, they can be put into a group and added together.&lt;br /&gt;
&lt;br /&gt;
The application will appear in the [https://portal.office.com/myapps My apps] page of the application launcher on the o365 portal for the users which have been assigned.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
&lt;br /&gt;
==== Create accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
&lt;br /&gt;
==== Update all accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
&lt;br /&gt;
==== Delete previously synced accounts in Moodle when they are deleted from Azure AD ====&lt;br /&gt;
This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
&lt;br /&gt;
==== Match preexisting Moodle users with same-named accounts in Azure AD ====&lt;br /&gt;
This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are case-insentitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
&lt;br /&gt;
==== Switch matched users to Office 365 (OpenID Connect) authentication ====&lt;br /&gt;
This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
&lt;br /&gt;
==== Assign users to application during sync ====&lt;br /&gt;
&lt;br /&gt;
The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle in cron job ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle on login ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
&lt;br /&gt;
==== Perform a full sync each run ====&lt;br /&gt;
&lt;br /&gt;
By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
&lt;br /&gt;
==== Match Azure usernames to moodle emails instead of moodle usernames during the sync ====&lt;br /&gt;
&lt;br /&gt;
Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third colum on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
====Tenants====&lt;br /&gt;
This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
&lt;br /&gt;
====Health Check====&lt;br /&gt;
If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
&lt;br /&gt;
====User Matching====&lt;br /&gt;
This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user.&lt;br /&gt;
&lt;br /&gt;
Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
&lt;br /&gt;
====Maintenance Tools====&lt;br /&gt;
These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
&lt;br /&gt;
=====Resync users in groups for courses=====&lt;br /&gt;
Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
&lt;br /&gt;
=====Recreate deleted Office 365 groups=====&lt;br /&gt;
Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
&lt;br /&gt;
=====Generate debug data package=====&lt;br /&gt;
This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
&lt;br /&gt;
=====Cleanup OpenID Connect Tokens=====&lt;br /&gt;
If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors.&lt;br /&gt;
&lt;br /&gt;
====Advanced settings====&lt;br /&gt;
=====Office 365 for China=====&lt;br /&gt;
Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
=====Record debug messages=====&lt;br /&gt;
If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
=====Minimum inexact username length to switch to Office 365=====&lt;br /&gt;
When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
=====Profile photo refresh time=====&lt;br /&gt;
Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
&lt;br /&gt;
====Legacy settings====&lt;br /&gt;
===== SharePoint Link =====&lt;br /&gt;
&#039;&#039;&#039;This feature is deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SharePoint sites can be created for each course on your Moodle site. You will provide a parent SharePoint site and subsites for each course will be automatically created. The document library for each of these subsites can then be accessed by teachers using the OneDrive for Business repository. This provides a shared store of files for a course, allowing teachers to collaborate on documents and share resources.&lt;br /&gt;
&lt;br /&gt;
* Any AzureAD-connected Moodle user with the &#039;&#039;&#039;moodle/course:managefiles&#039;&#039;&#039; capability in a course will be able to access the document library from the repository.&lt;br /&gt;
&lt;br /&gt;
====== Setting up the SharePoint connection ======&lt;br /&gt;
# Visit the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration).&lt;br /&gt;
# Under the &#039;&#039;&#039;Options&#039;&#039;&#039; tab, look for the &#039;&#039;&#039;SharePoint Link&#039;&#039;&#039; setting.&lt;br /&gt;
# Type in the URL of the parent SharePoint site you&#039;d like to use for the course subsites.&lt;br /&gt;
## This should be the entire URL to the SharePoint site - for example: &#039;&#039;&#039;https://contoso.sharepoint.com/moodle&#039;&#039;&#039;.&lt;br /&gt;
## This site must be accessible to the &#039;&#039;&#039;System API user&#039;&#039;&#039;&lt;br /&gt;
# When you are done typing in the URL, the URL will be checked for suitability.&lt;br /&gt;
## If the valid is invalid, you will see a red box and the text &amp;quot;This is not a usable SharePoint site.&amp;quot;&lt;br /&gt;
## If the site already exists, you will see a blue box and the text &amp;quot;This site is usable, but already exists&amp;quot;. You can use this site, but conflicts can arise. It&#039;s recommended to use a URL to a SharePoint site that doesn&#039;t yet exist. The site will be created during initialization.&lt;br /&gt;
## If the site does not exist but can be created, you will see a green box and the text &amp;quot;This SharePoint site will be created by Moodle and used for Moodle content.&amp;quot;. This SharePoint site will be created by Moodle during initialization.&lt;br /&gt;
# Click &#039;&#039;&#039;Save changes&#039;&#039;&#039; at the bottom of the settings page.&lt;br /&gt;
# You will see a spinning icon below the SharePoint Link setting, and the text &amp;quot;Moodle is setting up this SharePoint site.&amp;quot;. &#039;&#039;&#039;This will not automatically update - refresh the page to check if the connection has been set up.&#039;&#039;&#039;.&lt;br /&gt;
# The SharePoint Link is set up during the Moodle cron, so ensure your Moodle cron is set up and running.&lt;br /&gt;
&lt;br /&gt;
====Preview features====&lt;br /&gt;
=====Enable preview features=====&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in Team linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
==How will cookie changes in Chrome version 80 affect Teams integration?==&lt;br /&gt;
The stable release of the Google Chrome web browser (build 80, scheduled for release on February 4, 2020) features a change in how cookies are handled. This will include two changes:&lt;br /&gt;
* Cookies without a &#039;&#039;&#039;SameSite&#039;&#039;&#039; attribute will be treated as SameSite=Lax.&lt;br /&gt;
* Cookies with &#039;&#039;&#039;SameSite=None&#039;&#039;&#039; must also specify &#039;&#039;&#039;Secure&#039;&#039;&#039;, meaning they require a secure context.&lt;br /&gt;
The changes are explained in [https://web.dev/samesite-cookies-explained/ here] and [https://blog.chromium.org/2019/10/developers-get-ready-for-new.html here]&lt;br /&gt;
&lt;br /&gt;
Moodle and Microsoft Teams integration will be affected by this change, because the integration requires embedding Moodle pages in Teams. There is [https://tracker.moodle.org/browse/MDL-67175 an open item] in Moodle tracker about this change in general, but the code change proposed in the tracker item didn&#039;t get integrated in time for the last minor Moodle upgrade before Chrome 80 release date. As a result, all sites using Moodle and Microsoft Teams integration feature are strongly suggested to apply the patches proposed in the [https://tracker.moodle.org/browse/MDL-67175 tracker item] so that users with Chrome 80 can keep using Moodle tabs in Teams after upgrade.&lt;br /&gt;
* Patches are provided for all Moodle versions that are supported for core feature and security issues, i.e. 3.5, 3.6, 3.7 and 3.8.&lt;br /&gt;
* Patches are only required before this is integrated into the next Moodle minor release of the Moodle versions, which is scheduled at March 9th, 2020.&lt;br /&gt;
* After the next Moodle minor release, the patch should be removed as it would be integration into core Moodle code.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138589</id>
		<title>Office365</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Office365&amp;diff=138589"/>
		<updated>2020-09-28T14:16:18Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox plugin&lt;br /&gt;
|type = set&lt;br /&gt;
|set=https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72&lt;br /&gt;
|entry = &lt;br /&gt;
https://moodle.org/plugins/local_office365 https://moodle.org/plugins/local_o365 https://moodle.org/plugins/auth_oidc https://moodle.org/plugins/repository_office365 https://moodle.org/plugins/block_microsoft https://moodle.org/plugins/theme_boost_o365teams&lt;br /&gt;
|tracker = https://github.com/Microsoft/o365-moodle/issues&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/view.php?id=8273&lt;br /&gt;
|maintainer = See plugins directory entries&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
{{Note|[[OAuth 2 authentication]] (enabling users to log in to Moodle with their Microsoft account) and the [[OneDrive repository]] are included in the standard Moodle, so require no additional plugins to be installed.}}&lt;br /&gt;
= Introduction  =&lt;br /&gt;
Office 365 services complement the Moodle learning platform to provide a more productive experience for teachers and students.&lt;br /&gt;
== Differences from Moodle Core ==&lt;br /&gt;
Although Moodle core now provides Office 365 authentication and basic OneDrive repository support, the Office 365 plugin suite provides a much wider set of features.&lt;br /&gt;
&lt;br /&gt;
A few key features only found in the Office 365 plugin suite:&lt;br /&gt;
* User sync from Office 365/Azure AD to Moodle&lt;br /&gt;
* Automatic and manual user matching from Office 365/Azure AD to Moodle&lt;br /&gt;
* Calendar sync&lt;br /&gt;
* Course to Office 365 group sync and shared file repositories&lt;br /&gt;
* OneNote assignment submission and feedback types&lt;br /&gt;
* Office document embedding using Office web apps&lt;br /&gt;
* Fully customizable sign-in experience&lt;br /&gt;
= Requirements =&lt;br /&gt;
To use the Office 365 plugins, you need the following:&lt;br /&gt;
* An Office 365 subscription.&lt;br /&gt;
* A Microsoft Azure subscription.&lt;br /&gt;
* Moodle version 3.1 or above.&lt;br /&gt;
&lt;br /&gt;
= Plugins &amp;amp; Features =&lt;br /&gt;
The Office 365 set of plugins contains 5 core plugins, and 3 optional plugins, which provide a wide variety of features to enhance your Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Office 365 Local Plugin&#039;&#039;&#039; (local_office365)&lt;br /&gt;
** This is a shell plugin which has dependencies on the current version of each of the 4 other core plugins that make up the complete set. Installing this plugin ensures you have the current version of each of the functional plugins installed.&lt;br /&gt;
* &#039;&#039;&#039;OpenID Connect Authentication Plugin&#039;&#039;&#039; (auth_oidc)&lt;br /&gt;
** This plugin allows users to log in to Moodle using their Office 365 accounts.&lt;br /&gt;
** Users with existing Moodle accounts can switch to using this authentication plugin, and new users can log in with this plugin and have an account created for them.&lt;br /&gt;
** If the administrator allows, users can also choose to disconnect from OpenID Connect and revert their previous login method, or to a username/password.&lt;br /&gt;
** Features&lt;br /&gt;
*** Standards-Compliant OpenID Connect Authentication&lt;br /&gt;
*** Supports authorization code or resource-owner credentials grants&lt;br /&gt;
**** Users can log in to Moodle by clicking the identity provider on the login page, or by entering their OpenID Connect credentials.&lt;br /&gt;
*** Customizable Icon + Identity Provider name&lt;br /&gt;
**** The icon and identity provider name shown on the Moodle login page can be customized. A number of prechosen icons are available, as well as the ability to upload your own.&lt;br /&gt;
*** Provides hooks to link OpenID Connect accounts to Moodle accounts&lt;br /&gt;
**** If you do not want to change your users&#039; login method, you can still connect to an OpenID Connect provider. The plugin provides code-level hooks to link a Moodle account to an OpenID Connect account without changing the Moodle user&#039;s authentication method. This means you can obtain tokens from an OpenID Connect service in the background.&lt;br /&gt;
*** Optional user-self-service connection and disconnection&lt;br /&gt;
**** A user-facing page is available for users to switch to and from OpenID Connect authentication. Access to this page and feature is controlled by a capability so administrators can disable it.&lt;br /&gt;
* &#039;&#039;&#039;Office 365 support plugin&#039;&#039;&#039; (local_o365)&lt;br /&gt;
** This plugin provides most of the Office 365 integration back-end. This provides shared code to communicate with Office 365, and powers the calendar sync.&lt;br /&gt;
** Features&lt;br /&gt;
*** Calendar sync from/to Office 365 Outlook.&lt;br /&gt;
**** Users can sync site events, course events, assignment due dates, and their personal Moodle calendar to their Outlook calendar.&lt;br /&gt;
*** User Sync and Matching&lt;br /&gt;
**** Users can be synced from Azure AD, or matched with existing users.&lt;br /&gt;
*** Course Groups&lt;br /&gt;
**** Office 365 groups can be automatically created for each course in Moodle (or you can select which courses are used), and group membership is kept up-to-date with Moodle enrolments.&lt;br /&gt;
*** SharePoint sites for each Moodle course (Deprecated)&lt;br /&gt;
**** You can connect your Moodle instance to a SharePoint subsite. Sites below this will be created for each course in your Moodle instance, and the document library from each course subsite is accessible through the OneDrive for Business repository. The course subsite document library is accessible by course teachers, serving as a place for teachers to share documents.&lt;br /&gt;
**** This feature is now deprecated. It is mainly used to provide shared document repositories for courses, which can now be accomplished by course groups.&lt;br /&gt;
* &#039;&#039;&#039;Microsoft Block&#039;&#039;&#039; (block_microsoft)&lt;br /&gt;
** This block provides a user-facing menu to access various Office 365 integration features, resources, and preferences.&lt;br /&gt;
** Links to: Course SharePoint sites, Azure AD login preferences, Calendar sync preferences, OneNote notebooks, and the Office 365 integration user control panel.&lt;br /&gt;
* &#039;&#039;&#039;OneDrive for Business Repository&#039;&#039;&#039; (repository_office365)&lt;br /&gt;
** This is a repository plugin that communicates with OneDrive for Business. If the SharePoint link is configured, this also provides access to Moodle course SharePoint sites&#039; document libraries.&lt;br /&gt;
** Features&lt;br /&gt;
*** Import files into Moodle from OneDrive for Business&lt;br /&gt;
*** Upload files into OneDrive for Business from within Moodle&lt;br /&gt;
*** Link to files in OneDrive for Business so users always get the most up-to-date version.&lt;br /&gt;
*** Embed documents into Moodle courses so users can view documents directly on the site.&lt;br /&gt;
&lt;br /&gt;
== Optional Plugins ==&lt;br /&gt;
These 3 plugins provide support for OneNote assignment submission and feedback. While they are not required, they provide a powerful way to submit and review assignments.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;OneNote support plugin&#039;&#039;&#039; (local_onenote)&lt;br /&gt;
** This provides supporting and shared code used by all other OneNote plugins. Does not have an user interface or configuration by itself.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Feedback&#039;&#039;&#039; (assignfeedback_onenote)&lt;br /&gt;
** Allows teachers to leave feedback for students using OneNote.&lt;br /&gt;
* &#039;&#039;&#039;OneNote Assignment Submission&#039;&#039;&#039; (assignsubmission_onenote)&lt;br /&gt;
** Allows students to submit assignments using OneNote.&lt;br /&gt;
&lt;br /&gt;
== 3rd Party Plugins ==&lt;br /&gt;
* &#039;&#039;&#039;oEmbed Filter&#039;&#039;&#039; (filter_oembed)&lt;br /&gt;
** This filter converts links to a variety of sites into oembed-powered interactions.&lt;br /&gt;
** Provides [https://mix.office.com/ Office Mix] support for Moodle, allowing you to embed Office Mixes directly into any text within Moodle.&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
Tooling and guidance on deploying Scalable Moodle Clusters on Azure&lt;br /&gt;
* https://github.com/azure/moodle&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The packages are available from:&lt;br /&gt;
&lt;br /&gt;
* The [https://moodle.org/plugins/ Moodle Plugins directory]&lt;br /&gt;
** [https://moodle.org/plugins/browse.php?list=set&amp;amp;id=72 Office 365 Plugin Set]&lt;br /&gt;
* GitHub&lt;br /&gt;
** http://github.com/microsoft/o365-moodle&lt;br /&gt;
&lt;br /&gt;
When you log back in to your Moodle instance, you are presented with the all the plugin configuration options. Save the settings without configuring them for now, you will come back to them later.&lt;br /&gt;
&lt;br /&gt;
For information on installing plugins in Moodle see  [[Installing plugins]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
After you have the code installed in your Moodle instance, you&#039;ll need to do a bit of setup before you can use the plugins.&lt;br /&gt;
&lt;br /&gt;
=== Enable the OpenID Connect Authentication Plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Authentication&#039;&#039;&#039; and click &#039;&#039;&#039;Manage authentication&#039;&#039;&#039;&lt;br /&gt;
# Locate the OpenID Connect authentication plugin and click the eye icon to enable&lt;br /&gt;
# Click the Settings link for the plugin.&lt;br /&gt;
# Verify the Authorization and Token endpoints. These should be set by default but if not, set the endpoints to the following:&lt;br /&gt;
## &#039;&#039;&#039;Authorization Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/authorize&lt;br /&gt;
## &#039;&#039;&#039;Token Endpoint:&#039;&#039;&#039; https://login.microsoftonline.com/common/oauth2/token&lt;br /&gt;
# Note the Redirect URI. This should be the URI of your Moodle instance followed by /auth/oidc/. You will need to enter this value into Azure AD later, so note this value and put it aside.&lt;br /&gt;
## For example, https://www.example.com/auth/oidc/&lt;br /&gt;
## Notes:&lt;br /&gt;
### This is a fixed value that is derived from your Moodle site&#039;s configured URL (wwwroot). You cannot change this value directly. If you need to change it for any of the following reasons, you must change your Moodle site&#039;s configured domain name ($CFG-&amp;gt;wwwroot).&lt;br /&gt;
### This URL must be a fully qualified domain name pointing to your Moodle instance.&lt;br /&gt;
### If your Moodle installation is configured with an IP address pointing to your instance, you must change $CFG-&amp;gt;wwwroot in your config.php to a fully-qualified domain name.&lt;br /&gt;
### This domain name does not need to be publicly accessible (i.e. internet-wide), but does need to be accessible to users of your Moodle instance. So, for example, you can use a intranet-only domain name.&lt;br /&gt;
&lt;br /&gt;
=== Prepare your Office 365 account for single sign-on with your Moodle installation ===&lt;br /&gt;
You will need an Azure subscription. If you do not have one, you can create one by visiting [[http://azure.microsoft.com/en-us/pricing/free-trial/ Microsoft Azure Sign Up]]&lt;br /&gt;
&lt;br /&gt;
To use Moodle with Office 365 for SSO, you must [https://manage.windowsazure.com configure Microsoft Azure] to manage your Office 365 Microsoft Azure Active Directory:&lt;br /&gt;
# Create a new Active Directory.&lt;br /&gt;
# Select Use existing directory.&lt;br /&gt;
# Select &#039;&#039;&#039;I am ready to be signed out now&#039;&#039;&#039; and click the check mark.&lt;br /&gt;
# Sign in with your Office 365 subscription credentials.&lt;br /&gt;
# Click &#039;&#039;&#039;Continue&#039;&#039;&#039;.&lt;br /&gt;
# Log out and sign back in to your Azure account.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: During the setup, you are required to enter a credit card and phone number. If you do not setup virtual machines or use paid services on the subscription, and only use it to access the Azure Active Directory, you will not be charged for the subscription.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
The easiest way to register application in Azure is to run the PowerShell script downloaded from the plugin configuration page. Go to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration&#039;&#039;&#039;, it&#039;s the &#039;&#039;&#039;Download PowerShell Script&#039;&#039;&#039; button in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab. You should only follow the manual process if you are unable to setup the AzureAd app via PowerShell script.&lt;br /&gt;
&lt;br /&gt;
The manual steps are:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# In &#039;&#039;&#039;Redirect URI (optional)&#039;&#039;&#039; section, select &#039;&#039;&#039;Web&#039;&#039;&#039; and put the redirect URI from the OpenID Connect authentication plugin configuration. &#039;&#039;&#039;Ensure there is a trailing slash for this URI - i.e. https://example.com/auth/oidc/&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039;.&lt;br /&gt;
# You now have an application registered in Azure for Moodle. Move on to the next section to properly configure it.&lt;br /&gt;
&lt;br /&gt;
=== Configure application ===&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click on the App you created for Moodle.&lt;br /&gt;
## You may need to change the dropdown from &amp;quot;My apps&amp;quot; to &amp;quot;All apps&amp;quot;&lt;br /&gt;
# Locate the &#039;&#039;&#039;Application ID&#039;&#039;&#039;, note this value (write it down or copy it somewhere), and set it aside. You&#039;ll need it later.&lt;br /&gt;
# Click on the display name of the App to open its settings.&lt;br /&gt;
# From the menu on the left, go to &#039;&#039;&#039;Certificates &amp;amp; secrets&#039;&#039;&#039; link in &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
# Create a new client secret by clicking &#039;&#039;&#039;New client secret&#039;&#039;&#039; button.&lt;br /&gt;
## Enter a description, and select a duration for &amp;quot;Expires&amp;quot;&lt;br /&gt;
## Click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
## A value will appear under &#039;&#039;&#039;Value&#039;&#039;&#039;, note this key value (write it down or copy it somewhere) and set it aside. You&#039;ll need later.&lt;br /&gt;
# Configure &#039;&#039;&#039;Azure Activity Directory Graph&#039;&#039;&#039; Permissions&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039;, then choose &#039;&#039;&#039;Azure Active Directory Graph&#039;&#039;&#039; from &#039;&#039;&#039;Supported legacy APIs&#039;&#039;&#039; section.&lt;br /&gt;
## Click the checkbox for &#039;&#039;&#039;User.Read&#039;&#039;&#039; permissions in each of the &amp;quot;Delegated&amp;quot; permissions sections.&lt;br /&gt;
# Configure &#039;&#039;&#039;Microsoft Graph&#039;&#039;&#039; Permissions&lt;br /&gt;
## Click the &#039;&#039;&#039;API permissions&#039;&#039;&#039; link in &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
## Click &#039;&#039;&#039;Add a permission&#039;&#039;&#039; button.&lt;br /&gt;
## In &#039;&#039;&#039;Select an API&#039;&#039;&#039; section, choose &#039;&#039;&#039;Microsoft APIs&#039;&#039;&#039;, then choose &amp;quot;Microsoft Graph&amp;quot;.&lt;br /&gt;
## Click the checkbox for the following permissions in each of the &amp;quot;Application&amp;quot; and &amp;quot;Delegated&amp;quot; permissions sections: &lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Permission&lt;br /&gt;
! Display Name&lt;br /&gt;
! Use&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | Application Permissions&lt;br /&gt;
| &#039;&#039;&#039;Domain.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write domains&#039;&#039;&#039;&lt;br /&gt;
| Required to automatically detect your Office 365 tenant during setup.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write calendars in all mailboxes&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write files in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;10&amp;quot; | Delegated Permissions&lt;br /&gt;
| &#039;&#039;&#039;Notes.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all OneNote notebooks that user can access&#039;&#039;&#039;&lt;br /&gt;
| Required for the OneNote integration to create notebooks, sections, and pages for assignments.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.Read&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign-in and read user profile&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365, and to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;User.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all users&#039; full profiles&#039;&#039;&#039;&lt;br /&gt;
| Required to sync user information between Moodle and Office 365.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Group.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write all groups&#039;&#039;&#039;&lt;br /&gt;
| Required for course group integration.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.ReadWrite.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read and write directory data&#039;&#039;&#039;&lt;br /&gt;
| Required for setup detection and verification.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Directory.AccessAsUser.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Access directory as the signed in user&#039;&#039;&#039;&lt;br /&gt;
| Required to access Office 365 APIs.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Calendars.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user calendars&#039;&#039;&#039;&lt;br /&gt;
| Required for calendar event sync.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Files.ReadWrite&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Have full access to user files&#039;&#039;&#039;&lt;br /&gt;
| Required for the Office 365 repository to access, download, and upload files to OneDrive.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Sites.Read.All&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Read items in all site collections&#039;&#039;&#039;&lt;br /&gt;
| Required for SharePoint integration (deprecated)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;openid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Sign users in&#039;&#039;&#039;&lt;br /&gt;
| Required to sign users in using Office 365 (required for all integration).&lt;br /&gt;
|}&lt;br /&gt;
When you&#039;re done, click &#039;&#039;&#039;Add permissions&#039;&#039;&#039; at bottom of the page.&lt;br /&gt;
&lt;br /&gt;
=== Add a user to the app ===&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section.&lt;br /&gt;
# Click on the &#039;&#039;&#039;Enterprise applications&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click on the App you created for Moodle. Note this page lists all applications of all types, so make sure the right one is chosen in case there are applications with duplicate names.&lt;br /&gt;
# Click &#039;&#039;&#039;Users and groups&#039;&#039;&#039; under the &#039;&#039;&#039;Manage&#039;&#039;&#039; section.&lt;br /&gt;
# Add users to your application using the &#039;&#039;&#039;Add user&#039;&#039;&#039; button. Eventually all users who need to access Moodle from Office365 need to be added here. If the amount of users is large, they can be put into a group and added together.&lt;br /&gt;
&lt;br /&gt;
The application will appear in the [https://portal.office.com/myapps My apps] page of the application launcher on the o365 portal for the users which have been assigned.&lt;br /&gt;
&lt;br /&gt;
=== Enter Azure application credentials into Moodle ===&lt;br /&gt;
# Navigate to the OpenID Connect authentication plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Enter the &#039;&#039;&#039;Application ID&#039;&#039;&#039; value you noted earlier from Azure into the &#039;&#039;&#039;Application ID&#039;&#039;&#039; box on the screen.&lt;br /&gt;
# Enter the &#039;&#039;&#039;Key&#039;&#039;&#039; value you noted earlier from Azure into the &amp;quot;Key&amp;quot; box on the screen.&lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the screen.&lt;br /&gt;
&lt;br /&gt;
=== Configure the Office 365 support plugin ===&lt;br /&gt;
# Navigate to &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Local plugins&#039;&#039;&#039; and click &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039;&lt;br /&gt;
# Complete each of the steps as follows:&lt;br /&gt;
# &#039;&#039;&#039;Choose connection method&#039;&#039;&#039;&lt;br /&gt;
## Choose the method you want to use to connect to Office 365. Unless you have a special reason to use the System API user, choose &#039;&#039;&#039;Application access&#039;&#039;&#039;.&lt;br /&gt;
## Click &#039;&#039;&#039;Save changes&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Admin consent &amp;amp; additional information&#039;&#039;&#039;&lt;br /&gt;
## &#039;&#039;&#039;Admin consent:&#039;&#039;&#039; Every time you change a &#039;&#039;&#039;Requires admin&#039;&#039;&#039; permission in Azure, you will need an administrator to provide consent to use the permission. Clicking the &#039;&#039;&#039;Provide admin consent&#039;&#039;&#039; button will take you to a log in screen on Office 365. An administrator will have to log in, and then will be given the option to approve the new permissions.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant:&#039;&#039;&#039; This is the domain name that identifies your Office 365 subscription, for example &amp;quot;contoso.onmicrosoft.com&amp;quot;. If you know it, enter it in this box, if not, click the &amp;quot;Detect&amp;quot; button to attempt to detect the correct value.&lt;br /&gt;
## &#039;&#039;&#039;OneDrive for Business URL:&#039;&#039;&#039; This is the URL that your users use to access OneDrive for Business. This can usually be determined from your AzureAD tenant, for example, if your tenant is &amp;quot;contoso.onmicrosoft.com&amp;quot;, your OneDrive for Business URL is &amp;quot;contoso-my.sharepoint.com.&amp;quot; If you know the URL, enter it here, otherwise click &amp;quot;Detect&amp;quot; to attempt to detect the correct value. Only enter the domain name, do not include &amp;quot;http://&amp;quot;, &amp;quot;www.&amp;quot; or any trailing slashes. For example &amp;quot;contoso-my.sharepoint.com&amp;quot;, not &amp;quot;https://contoso-my.sharepoint.com/&amp;quot;&lt;br /&gt;
## Click Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Verify Setup&#039;&#039;&#039;&lt;br /&gt;
## This tool verifies that Azure has been correctly set up. Click the &amp;quot;Update&amp;quot; button to check setup.&lt;br /&gt;
## If the tool reports any missing permissions, return to Azure and ensure that all required permissions have been added to your configured application for Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting users to Office 365 ==&lt;br /&gt;
To use any Office 365 features, a Moodle user must be connected to an Office 365 user that has an active Office 365 subscription. There are two ways to connect a Moodle user to an Office 365 user.&lt;br /&gt;
&lt;br /&gt;
=== Switch the user to use OpenID Connect authentication. ===&lt;br /&gt;
With this method, the user will log in to Moodle using their Office 365 account credentials.&lt;br /&gt;
* Users who do not yet have a Moodle account can simply follow the normal OpenID Connect login process (see: [[Office365#Basic_Usage]]). If a Moodle account is not found for a user logging in with OpenID Connect, an account will be created for them.&lt;br /&gt;
* To migrate an existing Moodle user to OpenID Connect authentication, see [[Office365#Switching_existing_Moodle_users_to_use_Office_365_to_log_in]].&lt;br /&gt;
&lt;br /&gt;
=== Link a Moodle user to an Office 365 user. ===&lt;br /&gt;
Users in Moodle can also be linked to Office 365 users without changing the Moodle user&#039;s authentication method. Users will be able to log in as they always have, and still use all the Office 365 features.&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# As the user to link to Office 365, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# This user is now connected to the Office 365 user.&lt;br /&gt;
&lt;br /&gt;
= Office 365 Integration Local Plugin =&lt;br /&gt;
== Sync Settings ==&lt;br /&gt;
These features are accessible from the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration), on the &#039;&#039;&#039;Sync Settings&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
=== User Sync ===&lt;br /&gt;
This option controls how users are synced from Azure AD to Moodle. If enabled, users from Azure AD can be automatically created in Moodle. This feature can also delete users in Moodle when they are deleted from Azure AD, or attempt to automatically match Moodle users with users in the connected Azure AD.&lt;br /&gt;
&lt;br /&gt;
The main benefit of using this option, compared to having accounts created as users log in using OpenID Connect, is that you can manage and enrol users before they first log in, so everything is ready to go the first time they access Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
* The sync job runs in the Moodle cron, and syncs 1000 users at a time.&lt;br /&gt;
* By default, this runs once per day at 1:00 AM in the time zone local to your server.&lt;br /&gt;
* To sync large sets of users more quickly, you can increase the freqency of the Sync users with Azure AD task using the Scheduled tasks management page. See [[Scheduled_tasks]].&lt;br /&gt;
&lt;br /&gt;
There are several options that affect user sync:&lt;br /&gt;
&lt;br /&gt;
==== Create accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will create users in Moodle from each user in the linked Azure Active Directory. Only users which do not currently have Moodle accounts will have accounts created. New accounts will be set up to use their Office 365 credentials to log in to Moodle (using the OpenID Connect authentication plugin), and will be able to use all the features of the Office 365 plugin set.&lt;br /&gt;
&lt;br /&gt;
==== Update all accounts in Moodle for users in Azure AD ====&lt;br /&gt;
This will update all users in Moodle from each user in the linked Azure AD.&lt;br /&gt;
&lt;br /&gt;
==== Delete previously synced accounts in Moodle when they are deleted from Azure AD ====&lt;br /&gt;
This will delete users from Moodle if they are marked as deleted in Azure AD. The Moodle account will be deleted and all associated user information will be removed from Moodle. Be careful!&lt;br /&gt;
&lt;br /&gt;
==== Match preexisting Moodle users with same-named accounts in Azure AD ====&lt;br /&gt;
This will look at the each user in the linked Azure Active Directory and try to match them with a user in Moodle. This looks for matching usernames in Azure AD and Moodle. Matches are case-insentitive and ignore the Office 365 tenant. For example, &amp;quot;BoB.SmiTh&amp;quot; in Moodle would match &amp;quot;bob.smith@example.onmicrosoft.com&amp;quot;. Users who are matched will have their Moodle and Office accounts connected and will be able to use all Office 365/Moodle integration features. The user&#039;s authentication method will not change unless the setting below is enabled.&lt;br /&gt;
&lt;br /&gt;
==== Switch matched users to Office 365 (OpenID Connect) authentication ====&lt;br /&gt;
This requires the &amp;quot;Match&amp;quot; setting above to be enabled. When a user is matched, enabling this setting will switch their authentication method to OpenID Connect. They will then log in to Moodle with their Office 365 credentials. Note: Please ensure the OpenID Connect authentication plugin is enabled if you want to use this setting.&lt;br /&gt;
&lt;br /&gt;
==== Assign users to application during sync ====&lt;br /&gt;
&lt;br /&gt;
The sync will search all users in the linked Azure AD (other than those excluded by the User Creation Restriction, however not all users may be assigned to the Moodle application you created in Azure AD App Registration during early setup. This setting will assign any Azure AD users with a matching Moodle account to the Azure AD App for Moodle you created.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle in cron job ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - by cron job.&lt;br /&gt;
&lt;br /&gt;
==== Sync Office 365 profile photos to Moodle on login ====&lt;br /&gt;
&lt;br /&gt;
User&#039;s photos in the Moodle profile will be updated with their image from their Azure AD profile - on login.&lt;br /&gt;
&lt;br /&gt;
==== Perform a full sync each run ====&lt;br /&gt;
&lt;br /&gt;
By default user sync will only sync changes from Azure AD. Checking this option will force a full user sync each time.&lt;br /&gt;
&lt;br /&gt;
==== Match Azure usernames to moodle emails instead of moodle usernames during the sync ====&lt;br /&gt;
&lt;br /&gt;
Enabling this option will match Azure usernames to Moodle emails instead of the default behaviour which is Azure usernames to Moodle usernames.&lt;br /&gt;
&lt;br /&gt;
====User Creation Restriction====&lt;br /&gt;
During user sync, by default, all users from Azure AD will be created in Moodle. This setting allows you to set a required field and value that a user must have in Azure to have an account created in Moodle. For example, if you wanted to only have users from the &amp;quot;IT&amp;quot; department syncing into Moodle, you would choose the &amp;quot;Department&amp;quot; field, and enter &amp;quot;IT&amp;quot;. &lt;br /&gt;
====User Field Mapping====&lt;br /&gt;
This controls how information is synced from Azure AD to Moodle. The first column lists Azure fields, the second column lists Moodle fields, and the third column controls when information is synced. &lt;br /&gt;
To create mappings:&lt;br /&gt;
# Click &amp;quot;Add Mapping&amp;quot;&lt;br /&gt;
# In the row that appears, select an Azure field to bring into Moodle.&lt;br /&gt;
# In the second column on the same row, select a Moodle field to copy the value into.&lt;br /&gt;
# In the third colum on the same row, choose whether this only happens on user creation, on user login, or both.&lt;br /&gt;
# Click &amp;quot;Save Changes&amp;quot; at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
To Delete A Mapping&lt;br /&gt;
# Click the &amp;quot;X&amp;quot; button at the end of the row you want to delete. &lt;br /&gt;
# Click &amp;quot;Save changes&amp;quot; at the bottom of the page.&lt;br /&gt;
# Note this will only prevent future information syncing, it will not undo past operations.&lt;br /&gt;
&lt;br /&gt;
=== Teams Sync ===&lt;br /&gt;
The Teams sync setting creates teams in Microsoft Teams for courses in Moodle. Teams creation effectively results in team members being added to an Office 365 group, enabling all  group features to be usable.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
* Teams (group) membership is kept up-to-date with enrolments in Moodle. &lt;br /&gt;
* Provides an easy way to address all users in a course from Office 365. For example, a teacher can share a document from OneDrive with all of their students by choosing the user group, i.e. Teams members, for their course - they don&#039;t have to choose each student individually.&lt;br /&gt;
* Course group file stores are accessible from the Office 365 Moodle file repository plugin, allowing users to access group files from Moodle.&lt;br /&gt;
&lt;br /&gt;
The Teams sync option allows a great deal of customization. An administrator can choose to create Teams for all courses, and enable all settings, or customize the implementation. If administrators choose the &amp;quot;Customize&amp;quot; option for this setting, administrators can choose which courses have Teams created, and choose which features are enabled for each course.&lt;br /&gt;
&lt;br /&gt;
Once enabled, new Teams will be created every cron run for any enabled course that doesn&#039;t have a team set up. Once Teams are set up, membership will be maintained automatically whenever someone joins or leaves a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==== Teams vs Group ====&lt;br /&gt;
Microsoft Teams share the same base with Office 365 groups in many ways, notably they share the same GUID, and Team members are also group members, however, there is a significant difference in the requirements for creating a Team and creating a group - Team creation require at least one Team owner, while groups can be created without owner. This unfortunately has an impact on the Teams sync feature, when a Moodle course is processed by the Teams sync feature for the first time, assuming the &amp;quot;Teams&amp;quot; feature is enabled:&lt;br /&gt;
* If the course has at least one teacher who can be matched to an Office 365 user enrolled, a Team will be created, with the teacher as Team owner,&lt;br /&gt;
* If the course has no user enrolled with teacher role, or none user enrolled with teacher role is Office 365 user, only a group will be created.&lt;br /&gt;
&lt;br /&gt;
== Advanced settings ==&lt;br /&gt;
=== Administrator Tools ===&lt;br /&gt;
====Tenants====&lt;br /&gt;
This tool allows you to add additional Office 365 tenants to be used with Moodle. Users from additional tenants can log-in to Moodle using their Office 365 account, and use features like calendar sync and the OneDrive repository.&lt;br /&gt;
&lt;br /&gt;
====Health Check====&lt;br /&gt;
If you are experiencing problems with any Office 365 / Moodle features, click the &#039;&#039;&#039;Health Check&#039;&#039;&#039; link to run tests on your system and look for potential problems.&lt;br /&gt;
&lt;br /&gt;
====Connections====&lt;br /&gt;
This tool allows administrators to see and manage the connections between their Moodle users and Office 365 accounts. Each user in the system is listed alongside the Office 365 username the user is connected to, if any. Administrators can choose to manually connect or disconnect each user.&lt;br /&gt;
&lt;br /&gt;
====User Matching====&lt;br /&gt;
This tool allows administrators to manually match Moodle and Office 365 users using a CSV file. Administrators can upload a CSV file containing, on each line, a Moodle username, and Office 365 username, and a 1 or 0 indicating whether to enable Office 365 login for that user.&lt;br /&gt;
&lt;br /&gt;
Once uploaded, the file is processed in batches during the Moodle cron. The tool page will display the progress of this process.&lt;br /&gt;
&lt;br /&gt;
====Maintenance Tools====&lt;br /&gt;
These tools perform maintenance tasks that can help solve problems which may crop up from time to time. Generally, users should not need these tools unless they encounter the specific situation these tools are designed to solve.&lt;br /&gt;
&lt;br /&gt;
=====Resync users in groups for courses=====&lt;br /&gt;
Course group membership is kept up-to-date as users are enrolled and un-enrolled from courses in Moodle. If this membership gets out-of-date for whatever reason, this tool will force a resync of group membership.&lt;br /&gt;
&lt;br /&gt;
=====Recreate deleted Office 365 groups=====&lt;br /&gt;
Course groups are created from Moodle courses when using the course group feature. If a group is manually deleted from the Office 365 administrator panel, this tool will recreate it.&lt;br /&gt;
&lt;br /&gt;
=====Generate debug data package=====&lt;br /&gt;
This tool will generate a package of information that can be sent to the plugin suite maintainers to help debug problems in environment and setup. While no API keys are present, this information does contain a lot about your environment and setup, so please be careful about who you send this information to.&lt;br /&gt;
&lt;br /&gt;
=====Cleanup OpenID Connect Tokens=====&lt;br /&gt;
If your users are experiencing problems logging in using their Office 365 account, trying cleaning up OpenID Connect tokens. This removes stray and incomplete tokens that can cause errors.&lt;br /&gt;
&lt;br /&gt;
====Advanced settings====&lt;br /&gt;
=====Office 365 for China=====&lt;br /&gt;
Office 365 in China differs slightly in some technical aspects. If you are using Office 365 for China, select this box to ensure everything will work properly.&lt;br /&gt;
=====Record debug messages=====&lt;br /&gt;
If you experience problems using any Office 365 features in Moodle, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administration &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
=====Minimum inexact username length to switch to Office 365=====&lt;br /&gt;
When using automatic user matching, this setting can be used to exclude accounts with short names. The intended use of this is to avoid matching generic accounts like &amp;quot;admin&amp;quot;. This setting is the minimum length of a username required for automatic matching to match users.&lt;br /&gt;
=====Profile photo refresh time=====&lt;br /&gt;
Profile photo syncing can be a resource-intensive process, so this setting allows you to set a minimum time between profile photo refresh runs.&lt;br /&gt;
&lt;br /&gt;
====Legacy settings====&lt;br /&gt;
===== SharePoint Link =====&lt;br /&gt;
&#039;&#039;&#039;This feature is deprecated and is likely to be removed in a future version.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SharePoint sites can be created for each course on your Moodle site. You will provide a parent SharePoint site and subsites for each course will be automatically created. The document library for each of these subsites can then be accessed by teachers using the OneDrive for Business repository. This provides a shared store of files for a course, allowing teachers to collaborate on documents and share resources.&lt;br /&gt;
&lt;br /&gt;
* Any AzureAD-connected Moodle user with the &#039;&#039;&#039;moodle/course:managefiles&#039;&#039;&#039; capability in a course will be able to access the document library from the repository.&lt;br /&gt;
&lt;br /&gt;
====== Setting up the SharePoint connection ======&lt;br /&gt;
# Visit the plugin&#039;s settings page (Site Administration &amp;gt; Plugins &amp;gt; Local plugins &amp;gt; Microsoft Office 365 Integration).&lt;br /&gt;
# Under the &#039;&#039;&#039;Options&#039;&#039;&#039; tab, look for the &#039;&#039;&#039;SharePoint Link&#039;&#039;&#039; setting.&lt;br /&gt;
# Type in the URL of the parent SharePoint site you&#039;d like to use for the course subsites.&lt;br /&gt;
## This should be the entire URL to the SharePoint site - for example: &#039;&#039;&#039;https://contoso.sharepoint.com/moodle&#039;&#039;&#039;.&lt;br /&gt;
## This site must be accessible to the &#039;&#039;&#039;System API user&#039;&#039;&#039;&lt;br /&gt;
# When you are done typing in the URL, the URL will be checked for suitability.&lt;br /&gt;
## If the valid is invalid, you will see a red box and the text &amp;quot;This is not a usable SharePoint site.&amp;quot;&lt;br /&gt;
## If the site already exists, you will see a blue box and the text &amp;quot;This site is usable, but already exists&amp;quot;. You can use this site, but conflicts can arise. It&#039;s recommended to use a URL to a SharePoint site that doesn&#039;t yet exist. The site will be created during initialization.&lt;br /&gt;
## If the site does not exist but can be created, you will see a green box and the text &amp;quot;This SharePoint site will be created by Moodle and used for Moodle content.&amp;quot;. This SharePoint site will be created by Moodle during initialization.&lt;br /&gt;
# Click &#039;&#039;&#039;Save changes&#039;&#039;&#039; at the bottom of the settings page.&lt;br /&gt;
# You will see a spinning icon below the SharePoint Link setting, and the text &amp;quot;Moodle is setting up this SharePoint site.&amp;quot;. &#039;&#039;&#039;This will not automatically update - refresh the page to check if the connection has been set up.&#039;&#039;&#039;.&lt;br /&gt;
# The SharePoint Link is set up during the Moodle cron, so ensure your Moodle cron is set up and running.&lt;br /&gt;
&lt;br /&gt;
====Preview features====&lt;br /&gt;
=====Enable preview features=====&lt;br /&gt;
From time-to-time, we add features that use brand-new APIs or are slightly experimental in some way. These features often become part of our regular feature offering once they mature, but if you want to see the latest features we&#039;re working on, you can enable this setting to enable all preview features. Be careful though! These features do break from time to time.&lt;br /&gt;
&lt;br /&gt;
==Teams Settings==&lt;br /&gt;
This section allows configuration Moodle and Microsoft Teams integration. When fully configured, the integration will&lt;br /&gt;
* Automatically create Teams for Moodle courses configured to be synced.&lt;br /&gt;
* Automatically sync Moodle course users to Teams.&lt;br /&gt;
* Automatically create a Moodle tab in Team linking to the Moodle course page.&lt;br /&gt;
* Allow users to use Moodle courses right from Teams.&lt;br /&gt;
* Allow users to ask questions about their courses, assignments, grades and students from Teams using Moodle assistance bot.&lt;br /&gt;
* Forward all Moodle notifications to users to Teams.&lt;br /&gt;
Some features can be disabled if needed.&lt;br /&gt;
&lt;br /&gt;
===Prerequisite===&lt;br /&gt;
# &#039;&#039;&#039;OpenID Connect Authentication&#039;&#039;&#039; plugin is enabled and configured.&lt;br /&gt;
# &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; is enabled in &#039;&#039;&#039;HTTP security&#039;&#039;&#039; section of site configuration.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;HTTP security&amp;quot; in &amp;quot;Security&amp;quot; section.&lt;br /&gt;
## Find &#039;&#039;&#039;Allow frame embedding&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# Web services are enabled on the site.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Site administration&amp;quot; tab, go to &amp;quot;Advanced features&amp;quot;.&lt;br /&gt;
## Find &#039;&#039;&#039;Enable web services&#039;&#039;&#039; setting and make sure it&#039;s enabled.&lt;br /&gt;
## Save changes.&lt;br /&gt;
# &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039; are enabled.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Plugins&amp;quot; tab, go to &amp;quot;External services&amp;quot; in &amp;quot;Web services&amp;quot; section.&lt;br /&gt;
## From the list of web services in the &amp;quot;External service&amp;quot; part in &amp;quot;Built-in services&amp;quot; section, find &#039;&#039;&#039;Moodle Office 365 Webservices&#039;&#039;&#039;.&lt;br /&gt;
## If the web services is disabled, i.e. greyed out, go to its settings and enable it.&lt;br /&gt;
# Give &#039;&#039;&#039;Authenticated user&#039;&#039;&#039; role permission to create web service token.&lt;br /&gt;
## Login to the site as site administrator.&lt;br /&gt;
## Go to &amp;quot;Site administration&amp;quot;, then in the &amp;quot;Users&amp;quot; tab, go to &amp;quot;Define roles&amp;quot; in &amp;quot;Permissions&amp;quot; section.&lt;br /&gt;
## In the &amp;quot;Manage roles&amp;quot; tab, from the list of roles, find &amp;quot;Authenticated user&amp;quot; role, and click the edit icon for the role.&lt;br /&gt;
## From the list of permissions, find &amp;quot;Create a web service token&amp;quot;, i.e. moodle/webservice:createtoken, and set it to allow.&lt;br /&gt;
## Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Register Application in Azure ===&lt;br /&gt;
Note this is different from the application registered above to allow user login integration.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click &#039;&#039;&#039;New application&#039;&#039;&#039; on the top menu.&lt;br /&gt;
# Enter a name for your application (can be anything you want, but should let you know this is for Moodle Teams integration).&lt;br /&gt;
# Choose option applicable to your organisation in &#039;&#039;&#039;Supported account types&#039;&#039;&#039; section.&lt;br /&gt;
# Click &#039;&#039;&#039;Register&#039;&#039;&#039; button to finish registration.&lt;br /&gt;
# You should be redirected to the settings page of the newly registered app; if not, find the app from the list of apps, and go to the settings page by clicking on its name.&lt;br /&gt;
# Note the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; of the app, which will be used in plugin configuration in Moodle.&lt;br /&gt;
# From the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Certificates &amp;amp; Secrets&#039;&#039;&#039;, and create a new client secret by clicking the &#039;&#039;&#039;New client secret&#039;&#039;&#039; button. Note the secret which will be used in plugin configuration in Moodle.&lt;br /&gt;
# In &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle, fill in the &#039;&#039;&#039;Application (client) ID&#039;&#039;&#039; and the client secret in &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client Secret&#039;&#039;&#039; settings respectively.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Update authentication application settings in Azure ===&lt;br /&gt;
When performing &#039;&#039;&#039;Step 1/3: Register Moodle with Azure AD&#039;&#039;&#039; in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration, the PowerShell script downloaded from Moodle was used, you can skip this section. If you followed manual steps, or the application registration was completed before, you will need to follow these steps.&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# Click on the &#039;&#039;&#039;Azure Active Directory&#039;&#039;&#039; link from &#039;&#039;&#039;Azure services&#039;&#039;&#039; section, then &#039;&#039;&#039;App Registrations&#039;&#039;&#039; from &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left.&lt;br /&gt;
# Click the app created for Moodle. Note this is not the app for Moodle Teams integration, but the one used for authentication. You may need to show &#039;&#039;&#039;All applications&#039;&#039;&#039; if the app wasn&#039;t created by your account.&lt;br /&gt;
# Go to the settings of the application by clicking its name.&lt;br /&gt;
# In the &#039;&#039;&#039;Manage&#039;&#039;&#039; section on the left of the page, go to &#039;&#039;&#039;Authentication&#039;&#039;&#039;.&lt;br /&gt;
# In the list of &#039;&#039;&#039;Redirect URIs&#039;&#039;&#039;, add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://your.moodle.url/local/o365/sso_end.php&lt;br /&gt;
# If bot feature is to be enabled, also add the following entry, in type &#039;&#039;&#039;Web&#039;&#039;&#039;:&lt;br /&gt;
## https://token.botframework.com/.auth/web/redirect&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Bot configuration ===&lt;br /&gt;
This section is only required if you want to enable bot features in the configuration. If bot feature is not required, please skip.&lt;br /&gt;
==== Bot deployment====&lt;br /&gt;
# Go back to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; section of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration in Moodle as site administrator.&lt;br /&gt;
# Make sure &#039;&#039;&#039;Application ID&#039;&#039;&#039; and &#039;&#039;&#039;Client secret&#039;&#039;&#039; are configured and saved.&lt;br /&gt;
# Click &#039;&#039;&#039;Deploy to Azure&#039;&#039;&#039; button. This will start the process of bot deployment in Azure Portal in a popup window.&lt;br /&gt;
# Configure the following in the &#039;&#039;&#039;Custom deployment&#039;&#039;&#039; window:&lt;br /&gt;
## Choose your &#039;&#039;&#039;Subscription&#039;&#039;&#039;.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Resource group&#039;&#039;&#039;. you may need to create a new one.&lt;br /&gt;
## Choose your &#039;&#039;&#039;Location&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Pricing Tier&#039;&#039;&#039; - [https://azure.microsoft.com/en-us/pricing/details/cognitive-services/language-understanding-intelligent-services/ LUIS pricing tiers] are explained here. The free tier should be able to get you started.&lt;br /&gt;
## &#039;&#039;&#039;LUIS Region&#039;&#039;&#039; - Region where the LUIS resource will be deployed.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application ID&#039;&#039;&#039; - the application ID of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Application ID&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Bot Application Password&#039;&#039;&#039; - the client secret  of the Moodle Teams integration application, which is the same as &#039;&#039;&#039;Client Secret&#039;&#039;&#039; in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;Moodle URL&#039;&#039;&#039;.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application ID&#039;&#039;&#039; - The Application ID saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Application Key&#039;&#039;&#039; - The Application Key saved in the &#039;&#039;&#039;Setup&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
## &#039;&#039;&#039;Azure AD Tenant&#039;&#039;&#039; - The tenant name (xyz.onmicrosoft.com) of your Azure AD tenant.&lt;br /&gt;
## &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; - Paste the &#039;&#039;&#039;Shared Moodle Secret&#039;&#039;&#039; setting of in the &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration.&lt;br /&gt;
Once all configured, agree the terms and conditions, and click &#039;&#039;&#039;Purchase&#039;&#039;&#039;. This will start the bot deployment, which can take a few minutes to finish.&lt;br /&gt;
&lt;br /&gt;
==== Post deployment configuration====&lt;br /&gt;
After bot deployment is finished:&lt;br /&gt;
# Sign in to the [https://portal.azure.com Microsoft Azure Management Portal].&lt;br /&gt;
# In the &#039;&#039;&#039;Navigation&#039;&#039;&#039; section of the page, go to &#039;&#039;&#039;Resource groups&#039;&#039;&#039;.&lt;br /&gt;
# From the list of resource groups, select the one in which the bot was created and deployed.&lt;br /&gt;
# One of the resources in the group should be in type &#039;&#039;&#039;Web App Bot&#039;&#039;&#039;. Click its name to go to settings.&lt;br /&gt;
# Copy the &#039;&#039;&#039;Messaging endpoint&#039;&#039;&#039; of the resource (e.g. https://provisioned-bot-name.azurewebsites.net/api/messages), rename messages to webhook (Ex: https://provisioned-bot-name.azurewebsites.net/api/webook)&lt;br /&gt;
# Paste this endpoint to the &#039;&#039;&#039;Bot webhook end point&#039;&#039;&#039; field in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Check &#039;&#039;&#039;Bot feature enabled&#039;&#039;&#039; box in &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
=== Add Moodle app to Teams ===&lt;br /&gt;
Once all configured, you are ready to add Moodle app to Teams.&lt;br /&gt;
# Go to &#039;&#039;&#039;Teams Settings&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page.&lt;br /&gt;
# Click &#039;&#039;&#039;Download manifest file&#039;&#039;&#039; button. This will download a manifest file (in .zip format) which contains the Moodle app.&lt;br /&gt;
# Follow [https://docs.microsoft.com/en-gb/microsoftteams/platform/concepts/deploy-and-publish/apps-upload these instructions] to upload the app to the app catalog of your tenant.&lt;br /&gt;
# Once the app is uploaded to the catalog of your tenant, it can be used in any Teams in the tenant.&lt;br /&gt;
&lt;br /&gt;
== Teams Moodle app settings==&lt;br /&gt;
After downloading the manifest file of Moodle app, a new tab &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; will be made available in &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page, which contains a single setting to configure the app ID of the Moodle app uploaded to Teams. This is optional but recommended. If configured, all new Teams created by Moodle course sync will:&lt;br /&gt;
* automatically install the Moodle app,&lt;br /&gt;
* automatically create a Moodle tab in the &#039;&#039;&#039;General&#039;&#039;&#039; channel.&lt;br /&gt;
* automatically configure the Moodle tab to point to the Moodle course that&#039;s related to the Team.&lt;br /&gt;
&lt;br /&gt;
To configure the field, follow these steps:&lt;br /&gt;
# Log in Teams, and go to app catalog by clicking the &#039;&#039;&#039;Apps&#039;&#039;&#039; button from the navigation bar on the left.&lt;br /&gt;
# Find the &#039;&#039;&#039;Moodle&#039;&#039;&#039; app uploaded.&lt;br /&gt;
# Click the option icon of the app, which is located at the top right corner of the app image.&lt;br /&gt;
# Click &#039;&#039;&#039;Copy link&#039;&#039;&#039;.&lt;br /&gt;
# In a text editor, paste the copied content. It should contain an URL such as https://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. &lt;br /&gt;
# The last part of the URL, i.e. 00112233-4455-6677-8899-aabbccddeeff, is the app ID.&lt;br /&gt;
# Paste the app ID in the &#039;&#039;&#039;Moodle app ID&#039;&#039;&#039; setting on &#039;&#039;&#039;Teams Moodle app&#039;&#039;&#039; tab of &#039;&#039;&#039;Microsoft Office 365 Integration&#039;&#039;&#039; configuration page in Moodle.&lt;br /&gt;
# Save changes.&lt;br /&gt;
&lt;br /&gt;
= OpenID Connect Authentication Plugin =&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
Once configured, you should see a link named &amp;quot;OpenID Connect&amp;quot; on the Moodle login page. Clicking this link will redirect the browser to the identity provider. Users will log in there, and will be redirected back to Moodle. If they have logged in to Moodle using OpenID Connect before, they will be logged in to their existing Moodle account. If they have not logged in to Moodle with OpenID Connect before, an account will be created for them.&lt;br /&gt;
&lt;br /&gt;
Note: If the &amp;quot;Prevent account creation when authenticating&amp;quot; setting is enabled in Moodle, new accounts will not be created.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
There are a number of options you can use to customize how the plugin behaves. To configure the plugin, visit the plugin&#039;s settings page. (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
&lt;br /&gt;
====Provider Name====&lt;br /&gt;
The name entered here will be used through the OpenID Connect plugin and the Office 365 plugins to refer to the system used to log users in. For example, if your users are used to calling their Azure AD account their &amp;quot;School&amp;quot; account, you enter &amp;quot;School account&amp;quot; here, and all references to authentication will be &amp;quot;Log in with your School account&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Auto-Append====&lt;br /&gt;
When using the &amp;quot;Username/Password&amp;quot; login flow, this setting with automatically append a given string to an entered username. This is useful in Azure AD usernames, where a single domain name is often used for every user - i.e. [user]@contoso.onmicrosoft.com. Users would normally have to enter this entire username to successfully log in to Moodle, but in this example, entering &amp;quot;@contoso.onmicrosoft.com&amp;quot; here means users would only have to enter their unique username, i.e. &amp;quot;bob.smith&amp;quot;, instead of &amp;quot;bob.smith@contoso.onmicrosoft.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Domain Hint====&lt;br /&gt;
If users have several different Azure AD accounts with different tenants (i.e. @contoso.onmicrosoft.com, @example.onmicrosoft.com), but Moodle only uses one of these tenants, you can enter that tenant in this box to have the Azure AD login screen only ever suggest accounts from that tenant.&lt;br /&gt;
&lt;br /&gt;
====Login Flow====&lt;br /&gt;
This setting changes how users log in to Moodle using the plugin. You can redirect users to the OpenID Connect provider&#039;s login page, or have users enter their credentials directly into Moodle. See the &amp;quot;Login Flows&amp;quot; section below for further information.&lt;br /&gt;
&lt;br /&gt;
====User Restrictions====&lt;br /&gt;
This setting allows you to restrict the users that can log in to Moodle using OpenID Connect (Azure AD).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve entered at least one user restriction, users logging in to Moodle must match at least one entered pattern.&lt;br /&gt;
&lt;br /&gt;
How to use user restrictions:&lt;br /&gt;
# Enter a regular expression pattern that matches the usernames of users you want to allow.&lt;br /&gt;
# Enter one pattern per line&lt;br /&gt;
# If you enter multiple patterns a user will be allowed if they match ANY of the patterns.&lt;br /&gt;
# The character &amp;quot;/&amp;quot; should be escaped with &amp;quot;\&amp;quot;.&lt;br /&gt;
# If you don&#039;t enter any restrictions above, all users that can log in to the OpenID Connect provider will be accepted by Moodle.&lt;br /&gt;
# Any user that does not match any entered pattern(s) will be prevented from logging in using OpenID Connect.&lt;br /&gt;
&lt;br /&gt;
====Record debug messages====&lt;br /&gt;
If you experience problems using OpenID Connect, enable this setting. Once enabled, errors will be recorded to the Moodle log for review. These errors can help you or the plugin developers debug and fix the problem. The error log can be viewed by navigating to Site Administation &amp;gt; Reports &amp;gt; Logs, changing the &amp;quot;All activities&amp;quot; select box to &amp;quot;Site errors&amp;quot;, and clicking &amp;quot;Get these logs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Custom Icon====&lt;br /&gt;
This setting allows you to choose from a selection of predefined icons to appear next to the identity provider link on the login page. You can also upload your own icon.&lt;br /&gt;
&lt;br /&gt;
# Visit the plugin settings page (Site Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; OpenID Connect)&lt;br /&gt;
# Locate the &amp;quot;Icon&amp;quot; section of the settings page.&lt;br /&gt;
# There are several predefined icons to choose from, clicking an icon will use that icon on the login page.&lt;br /&gt;
# To use a custom icon, use the file picker below the &amp;quot;Icon&amp;quot; setting.&lt;br /&gt;
## This image will not be resized on the login page, so we recommend uploading an image no bigger than 35x35 pixels.&lt;br /&gt;
## If you have uploaded a custom icon and want to go back to one of the stock icons, click the custom icon in the file picker and click &amp;quot;Delete&amp;quot;, then &amp;quot;OK&amp;quot;, then &amp;quot;Save Changes&amp;quot; at the bottom of the settings page. The selected stock icon will now appear on the Moodle login page.&lt;br /&gt;
&lt;br /&gt;
== Login flows ==&lt;br /&gt;
This plugin supports two different methods for users to log in: Authorization Request and Username/Password Authentication&lt;br /&gt;
&lt;br /&gt;
=== Authorization Request ===&lt;br /&gt;
This flow redirects the user to Office 365 to log in and are then brought back to Moodle logged in.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user clicks the name of the identity provider (What you entered in the &amp;quot;Provider Name&amp;quot; box at the top of the settings page.) on the Moodle login page.&lt;br /&gt;
# The user is redirected to Office 365 to log in.&lt;br /&gt;
# Once successfully logged in, the user is redirected back to Moodle where the Moodle login takes place transparently.&lt;br /&gt;
&lt;br /&gt;
=== Username/Password Authentication ===&lt;br /&gt;
This login flow works like a classic username and password, except the user uses their Office 365 account information.&lt;br /&gt;
&lt;br /&gt;
Using this flow:&lt;br /&gt;
# The user enters their Office 365 username and password directly into the Moodle login form.&lt;br /&gt;
# Their credentials are securely sent to Office 365 for verification.&lt;br /&gt;
# If the credentials are verified, the user is logged in to Moodle.&lt;br /&gt;
&lt;br /&gt;
== Switching existing Moodle users to use Office 365 to log in ==&lt;br /&gt;
If a user logs in to Moodle using OpenID Connect but does not have a Moodle account, one will be created for them. However, existing Moodle users can be migrated to use OpenID Connect and provide a connection to Office 365.&lt;br /&gt;
&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Click the &#039;&#039;&#039;Office 365 Login&#039;&#039; link under &#039;&#039;&#039;Office 365 Features&#039;&#039;&#039;&lt;br /&gt;
# Click the &amp;quot;Start using Office 365 to log in to Moodle.&amp;quot; link.&lt;br /&gt;
# You will be redirected to Office 365 to log in. Log in with the account you&#039;d like to link to the Moodle account you&#039;re using.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# The Moodle account will now use Office 365 to log in. &#039;&#039;&#039;The previous login method will not work.&#039;&#039;&#039;&lt;br /&gt;
# The Moodle user can now use any of the Office 365 features in Moodle.&lt;br /&gt;
&lt;br /&gt;
== Connecting existing Moodle users to Office 365 without changing login method ==&lt;br /&gt;
# Ensure the Microsoft block has been added to a page in Moodle (for example, the Moodle dashboard).&lt;br /&gt;
# Log in as the user to be migrated, visit a page that has the Microsoft block visible.&lt;br /&gt;
# Click the &#039;&#039;&#039;Connect to Office 365&#039;&#039;&#039; link in the Microsoft block.&lt;br /&gt;
# You will be brought to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# There will be a &amp;quot;Connection Status&amp;quot; indicator box on the right side of the screen, click the &amp;quot;Click here to connect&amp;quot; link.&lt;br /&gt;
# You will be brought to the AzureAD authentication screen. Log in with the Office 365 user&#039;s credentials you&#039;d like to connect to the Moodle user you are logged in as.&lt;br /&gt;
## &#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you&#039;re already logged in to Office 365, you will not have to enter your credentials on the Office 365 login page. This Office 365 account will be linked to the Moodle account. Ensure you are logged in to the correct account, or log out of Office 365 first to show the Office 365 login screen.&lt;br /&gt;
# If login was successful, you will be brought back to the &#039;&#039;&#039;Office 365 / Moodle Control Panel&#039;&#039;&#039; page, where the Office 365 connection indicator should now read &#039;&#039;&#039;Active&#039;&#039;&#039;.&lt;br /&gt;
# The Moodle account is now linked to the Office 365 account and can use Office 365 features as that user.&lt;br /&gt;
# The Moodle user&#039;s login method will not change, the user will log in to Moodle as they always have.&lt;br /&gt;
&lt;br /&gt;
= OneDrive for Business Repository =&lt;br /&gt;
The OneDrive for Business repository allows users using the Office 365 integration plugins to connect to their OneDrive for Business as a Moodle repository.&lt;br /&gt;
&lt;br /&gt;
== Downloading and linking files ==&lt;br /&gt;
# When using a filepicker anywhere in Moodle, you&#039;ll see a list of repositories on the left side of the popup. Look for and click on &amp;quot;OneDrive for Business&amp;quot;.&lt;br /&gt;
# You&#039;ll see two folders - &amp;quot;My Files&amp;quot; and &amp;quot;Courses&amp;quot;. Click the folder for the document library you want to access.&lt;br /&gt;
## &#039;&#039;&#039;My Files&#039;&#039;&#039; contains all documents in your personal OneDrive for Business&lt;br /&gt;
## &#039;&#039;&#039;Courses&#039;&#039;&#039; will list all Moodle course shared document libraries that you have access to. If you want to download files from one of these, you&#039;ll click &amp;quot;Courses&amp;quot;, then click the folder for the course you want to access.&lt;br /&gt;
# You will now see a list of all the files and folders in your OneDrive.&lt;br /&gt;
# Click the file you want to download into Moodle.&lt;br /&gt;
# Choose to &amp;quot;Make a copy of the file&amp;quot;, or &amp;quot;Create an alias/shortcut to the file.&amp;quot;&lt;br /&gt;
## If you want to download a copy of the file as it is now, choose &amp;quot;Make a cope of the file&amp;quot;. This will copy the file into Moodle, and will then use the local Moodle copy when the file is accessed from within Moodle. Any changes to the file in OneDrive will not be seen in Moodle.&lt;br /&gt;
## If you want to link a file choose &amp;quot;Create an alias/shortcut to the file&amp;quot;. This will create a link in Moodle to the file in OneDrive, and the file will be accessed from OneDrive directly. Any changes to the file in OneDrive will be seen when accessing the file from Moodle.&lt;br /&gt;
# You can change other file information like the filename or author name using the respective text fields. This information is only applicable to the Moodle side of the file, and will not transfer to OneDrive.&lt;br /&gt;
# Click &amp;quot;Select this file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Uploading files ==&lt;br /&gt;
You can upload files into both your personal OneDrive for Business document library and a course SharePoint document library from the filepicker interface.&lt;br /&gt;
&lt;br /&gt;
# When accessing a OneDrive document library from a file picker, you will see an &amp;quot;Upload New File&amp;quot; item in the list of files and folders.&lt;br /&gt;
# Click the &amp;quot;Upload new file&amp;quot; item.&lt;br /&gt;
# Choose the file you want to upload and click &amp;quot;Upload this file&amp;quot;.&lt;br /&gt;
# The file will be uploaded to OneDrive and selected for the file picker.&lt;br /&gt;
&lt;br /&gt;
== Embedding Office documents ==&lt;br /&gt;
This repository allows users to embed Office documents from OneDrive into a course and have the live version viewable using Office web apps.&lt;br /&gt;
&lt;br /&gt;
# Start as a user connected to Office 365 and who has access to modify a course.&lt;br /&gt;
# Turn on editing for the course and choose &amp;quot;Add an activity or resource&amp;quot; for the section of the course you want to add the document.&lt;br /&gt;
# Choose the &amp;quot;File&amp;quot; resource to add to the course.&lt;br /&gt;
# In the &amp;quot;Content&amp;quot; section of the file resource settings page, click the &amp;quot;Add&amp;quot; button in the filepicker&lt;br /&gt;
# Choose the &amp;quot;OneDrive for Business&amp;quot; repository and choose your Office document.&lt;br /&gt;
# When you select a file, make sure &amp;quot;Create an alias/shortcut to the file&amp;quot; is selected, the click &amp;quot;Select this file&amp;quot;&lt;br /&gt;
# Expand the &amp;quot;Appearance&amp;quot; section, and choose &amp;quot;Embed&amp;quot; for the &amp;quot;Display&amp;quot; select box.&lt;br /&gt;
# Click &amp;quot;Save and display&amp;quot;&lt;br /&gt;
# You should see the file embedded into the page.&lt;br /&gt;
&lt;br /&gt;
= OneNote =&lt;br /&gt;
OneNote is now available through Office 365. If you have installed all the plugins (for example, by installing [https://moodle.org/plugins/view/local_office365]) then you already have the OneNote plugins installed. To access OneNote using your Office 365 subscription, add OneNote to the list of applications in your Azure application. This is done the same way you configured Azure permissions, above. Note that OneNote is still in preview, and may not be available to everyone yet. If you don&#039;t see OneNote in the list of applications to add to your Azure application, you can try logging in to a desktop OneNote application using an administrator account in your Office 365 tenant. This sometimes expedites to the process of adding the OneNote preview to your tenant. &lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
==How will cookie changes in Chrome version 80 affect Teams integration?==&lt;br /&gt;
The stable release of the Google Chrome web browser (build 80, scheduled for release on February 4, 2020) features a change in how cookies are handled. This will include two changes:&lt;br /&gt;
* Cookies without a &#039;&#039;&#039;SameSite&#039;&#039;&#039; attribute will be treated as SameSite=Lax.&lt;br /&gt;
* Cookies with &#039;&#039;&#039;SameSite=None&#039;&#039;&#039; must also specify &#039;&#039;&#039;Secure&#039;&#039;&#039;, meaning they require a secure context.&lt;br /&gt;
The changes are explained in [https://web.dev/samesite-cookies-explained/ here] and [https://blog.chromium.org/2019/10/developers-get-ready-for-new.html here]&lt;br /&gt;
&lt;br /&gt;
Moodle and Microsoft Teams integration will be affected by this change, because the integration requires embedding Moodle pages in Teams. There is [https://tracker.moodle.org/browse/MDL-67175 an open item] in Moodle tracker about this change in general, but the code change proposed in the tracker item didn&#039;t get integrated in time for the last minor Moodle upgrade before Chrome 80 release date. As a result, all sites using Moodle and Microsoft Teams integration feature are strongly suggested to apply the patches proposed in the [https://tracker.moodle.org/browse/MDL-67175 tracker item] so that users with Chrome 80 can keep using Moodle tabs in Teams after upgrade.&lt;br /&gt;
* Patches are provided for all Moodle versions that are supported for core feature and security issues, i.e. 3.5, 3.6, 3.7 and 3.8.&lt;br /&gt;
* Patches are only required before this is integrated into the next Moodle minor release of the Moodle versions, which is scheduled at March 9th, 2020.&lt;br /&gt;
* After the next Moodle minor release, the patch should be removed as it would be integration into core Moodle code.&lt;br /&gt;
&lt;br /&gt;
=Any further questions?=&lt;br /&gt;
&lt;br /&gt;
For support, please open an issue on Github at [https://github.com/Microsoft/o365-moodle/issues]&lt;br /&gt;
&lt;br /&gt;
For community discussion, please post in the [https://moodle.org/mod/forum/view.php?id=8273 Moodle office tool integrations forum] on moodle.org. Note: developers may or may not see questions in this forum thread.&lt;br /&gt;
&lt;br /&gt;
[[es:Office365]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=133239</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=133239"/>
		<updated>2019-03-07T10:20:28Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: Replaced content with &amp;quot;The module is not maintained.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The module is not maintained.&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Code_syntax_highlighting&amp;diff=131001</id>
		<title>Code syntax highlighting</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Code_syntax_highlighting&amp;diff=131001"/>
		<updated>2018-05-14T09:44:07Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can color or highlight code snippets within Moodle resources, forum posts etc. To do so you must install the GeSHi (Generic Syntax Highlighter) Filter. This makes the power of GeSHi available in Moodle through the use of a pair of special tags.&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
&lt;br /&gt;
You can download the GeSHi filter from here:&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=filter_geshi&lt;br /&gt;
&lt;br /&gt;
To install, unzip that archive into your filter/ directory and then enable it in the admin filter configuration screen.&lt;br /&gt;
&lt;br /&gt;
== Instructions for use ==&lt;br /&gt;
&lt;br /&gt;
Enclose your code in spans under the source of html editor like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;span syntax=&amp;quot;code&amp;quot;&amp;gt;your code goes here&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;span syntax=&amp;quot;code&amp;quot; linenumbers=&amp;quot;yes&amp;quot;&amp;gt;your code with line numbers&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Supported languages ===&lt;br /&gt;
&lt;br /&gt;
* asm,&lt;br /&gt;
* bash,&lt;br /&gt;
* cpp,&lt;br /&gt;
* [[CSS]]&lt;br /&gt;
* lisp&lt;br /&gt;
* matlab&lt;br /&gt;
* [[HTML in Moodle]]&lt;br /&gt;
* [[PHP]]&lt;br /&gt;
* pascal&lt;br /&gt;
* sql&lt;br /&gt;
* xml&lt;br /&gt;
&lt;br /&gt;
and many others. See the GeSHi homepage for full details.&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
&lt;br /&gt;
See the examples above. This filter is still under development so things may change.&lt;br /&gt;
&lt;br /&gt;
== Demo ==&lt;br /&gt;
&lt;br /&gt;
The GeSHi homepage also has an interactive demo.&lt;br /&gt;
&lt;br /&gt;
http://qbnz.com/highlighter/demo.php&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
The last development for this filter appears to have been in 2017. Bug reports are welcome, please post them in the [https://github.com/enovation/moodle-filter_geshi/issues github issues system].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://qbnz.com/highlighter/ GeSHi homepage]&lt;br /&gt;
* [[MoodleDocs:Style_guide#PHP_syntax_highlighting]] that does not need any additional filter&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Filter]]&lt;br /&gt;
&lt;br /&gt;
[[es:Resaltado de sintaxis de codigo]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=Code_syntax_highlighting&amp;diff=111611</id>
		<title>Code syntax highlighting</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=Code_syntax_highlighting&amp;diff=111611"/>
		<updated>2014-04-07T15:39:06Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can color or highlight code snippets within Moodle resources, forum posts etc. To do so you must install the GeSHi (Generic Syntax Highlighter) Filter. This makes the power of GeSHi available in Moodle through the use of a pair of special tags.&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
&lt;br /&gt;
You can download the GeSHi filter from here:&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=filter_geshi&lt;br /&gt;
&lt;br /&gt;
To install, unzip that archive into your filter/ directory and then enable it in the admin filter configuration screen.&lt;br /&gt;
&lt;br /&gt;
== Instructions for use ==&lt;br /&gt;
&lt;br /&gt;
Enclose your code in spans under the source of html editor like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;span syntax=&amp;quot;code&amp;quot;&amp;gt;your code goes here&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;span syntax=&amp;quot;code&amp;quot; linenumbers=&amp;quot;yes&amp;quot;&amp;gt;your code with line numbers&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Supported languages ===&lt;br /&gt;
&lt;br /&gt;
* asm,&lt;br /&gt;
* bash,&lt;br /&gt;
* cpp,&lt;br /&gt;
* [[CSS]]&lt;br /&gt;
* lisp&lt;br /&gt;
* matlab&lt;br /&gt;
* [[HTML in Moodle]]&lt;br /&gt;
* [[PHP]]&lt;br /&gt;
* pascal&lt;br /&gt;
* sql&lt;br /&gt;
* xml&lt;br /&gt;
&lt;br /&gt;
and many others. See the GeSHi homepage for full details.&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
&lt;br /&gt;
See the examples above. This filter is still under development so things may change.&lt;br /&gt;
&lt;br /&gt;
== Demo ==&lt;br /&gt;
&lt;br /&gt;
The GeSHi homepage also has an interactive demo.&lt;br /&gt;
&lt;br /&gt;
http://qbnz.com/highlighter/demo.php&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
The last development for this filter appears to have been in 2008. Bug reports are welcome, please post them in the [https://github.com/enovation/moodle-filter_geshi/issues github issues system].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://qbnz.com/highlighter/ GeSHi homepage]&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Filter]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103701</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103701"/>
		<updated>2013-03-20T13:00:57Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Screenshots:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen1.jpg|thumbnail|left|link=https://docs.moodle.org/24/en/images_en/9/97/360_screen1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen2.jpg|thumbnail|left|link=https://docs.moodle.org/24/en/images_en/c/c0/360_screen2.jpg]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103700</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103700"/>
		<updated>2013-03-20T12:59:29Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Screenshots:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen1.jpg|thumbnail|left|link=https://docs.moodle.org/24/en/images_en/c/c0/360_screen2.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen2.jpg|thumbnail|left]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103699</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103699"/>
		<updated>2013-03-20T12:56:31Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Screenshots:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:images_en/c/c0/360_screen2.jpg|thumbnail|left|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen2.jpg|thumbnail|left]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103698</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103698"/>
		<updated>2013-03-20T11:59:04Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Screenshots:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen1.jpg|thumbnail|left|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen2.jpg|thumbnail|left]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103697</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103697"/>
		<updated>2013-03-20T11:58:39Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Screenshots:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen1.jpg|thumbnail|left||preview]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen2.jpg|thumbnail|left]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103696</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103696"/>
		<updated>2013-03-20T11:57:49Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Screenshots:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:images_en/c/c0/360_screen2.jpg|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen2.jpg|thumbnail|left]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103695</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103695"/>
		<updated>2013-03-20T11:52:10Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Screenshots:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen1.jpg|thumbnail|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen2.jpg|thumbnail|left]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103693</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103693"/>
		<updated>2013-03-20T11:49:38Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Screenshots:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen1.jpg|thumbnail|left|preview]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen2.jpg|thumbnail|left]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103692</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103692"/>
		<updated>2013-03-20T11:46:03Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Screenshots:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen1.jpg|thumbnail|left]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen2.jpg|thumbnail|left]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103691</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103691"/>
		<updated>2013-03-20T11:45:26Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Screenshots:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen1.jpg|thumbnail]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen2.jpg|thumbnail]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103690</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103690"/>
		<updated>2013-03-20T11:40:58Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Screenshots:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen1.jpg|thumbnail]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen2.jpg]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103689</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103689"/>
		<updated>2013-03-20T11:33:00Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Screenshots:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen2.jpg]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=File:360_screen2.jpg&amp;diff=103688</id>
		<title>File:360 screen2.jpg</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=File:360_screen2.jpg&amp;diff=103688"/>
		<updated>2013-03-20T11:31:59Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103687</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103687"/>
		<updated>2013-03-20T11:31:25Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
[[File:360_screen1.jpg]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=File:360_screen1.jpg&amp;diff=103685</id>
		<title>File:360 screen1.jpg</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=File:360_screen1.jpg&amp;diff=103685"/>
		<updated>2013-03-20T11:29:01Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: uploaded a new version of &amp;amp;quot;File:360 screen1.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103684</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103684"/>
		<updated>2013-03-20T11:27:58Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
[[File:Example.jpg]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103683</id>
		<title>ThreeSixty module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/39/en/index.php?title=ThreeSixty_module&amp;diff=103683"/>
		<updated>2013-03-20T11:26:16Z</updated>

		<summary type="html">&lt;p&gt;Enovationdevteam: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Activity module&lt;br /&gt;
|entry = ... &lt;br /&gt;
|tracker = ...&lt;br /&gt;
|discussion = ...&lt;br /&gt;
|maintainer = Enovation Solutions&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
360 Feedback is the way to gather performance information about individual (employee) from much broader perspective than just his/hers line manager. This tool allows to define number of participants who will take part in givin feedback about particular person based on some pre-set criteria by “rating” this person and also leaving comments. Participants can be a coleague, customer, supervisor etc.&lt;br /&gt;
&lt;br /&gt;
Feedback is only completed when all participants have reviewed and submitted the form.&lt;br /&gt;
&lt;br /&gt;
==Using 360 Module:==&lt;br /&gt;
&lt;br /&gt;
Download module 360:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://moodle.org/plugins/view.php?plugin=mod_threesixty&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
https://github.com/enovation/moodle-mod-360&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy and paste “threesixty” directory in {moodle_root}/mod/&lt;br /&gt;
In browser, go to url /admin/index.php to install new pluguin.&lt;br /&gt;
&lt;br /&gt;
Take all defaults for now.&lt;br /&gt;
&lt;br /&gt;
Go to Site Administration-&amp;gt;Plugins-&amp;gt;Activity Modules-&amp;gt;360 Degree Diagnostics Tool&lt;br /&gt;
&lt;br /&gt;
Here you can change those default settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To see how it works:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Go to any course, for this example I go to “Networks”, turn editing on.&lt;br /&gt;
&lt;br /&gt;
Click on Add an activity or resource&lt;br /&gt;
&lt;br /&gt;
Choose radio button next to “360 Degree Diagnostics Tool” and click “Add” button.&lt;br /&gt;
&lt;br /&gt;
Once 360 feedback has been added to the course, it can be accessed by anyone who is enrolled in that course.&lt;br /&gt;
For this example, we call it “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
Once user clicks on “New 360 Feedback” he/she brought to the home page of the tool which displays following options:&lt;br /&gt;
&lt;br /&gt;
* Activity&lt;br /&gt;
* Respondents&lt;br /&gt;
* Reports&lt;br /&gt;
* Administration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Activity:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When clicking on activity we see list of students enrolled in the course.&lt;br /&gt;
&lt;br /&gt;
Each user has 2 profiles associated with him/her: “Self” and “Job Profile”.&lt;br /&gt;
&lt;br /&gt;
“Date Completed” will show the date once profile has been completed.&lt;br /&gt;
&lt;br /&gt;
There are also “Options” which is currently shows only option to view.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Respondents and Reports&#039;&#039;&#039; will show no information at this point, because activity is not completed yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Administration:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to “Adds/Edit competencies” or “Carry over skills”.&lt;br /&gt;
&lt;br /&gt;
As there is no competencies defined yet, we will add a new competency:&lt;br /&gt;
&lt;br /&gt;
Click “Add a new competency”.&lt;br /&gt;
&lt;br /&gt;
We will name this competency “Network Administration” and add a description.&lt;br /&gt;
&lt;br /&gt;
Next we will add skills: “Install and configure small network” and “Troubleshoot network”, also adding a description to each of them.&lt;br /&gt;
&lt;br /&gt;
Click “Save”.&lt;br /&gt;
&lt;br /&gt;
Now we can see new competency displayed in the table in “Administration” section and showing name of competency, description, skills, feedback (yes/no) and option to edit or delete.&lt;br /&gt;
&lt;br /&gt;
If we click “Edit” we will see the form that we just filled in where we can amend any information that we entered earlier. Currently there are space for 4 skills, but there is a button on the bottom of the form that allows to add 2 additional skills on each click (e.g. if clicked twice we will end up with space for 8 skills to enter).&lt;br /&gt;
&lt;br /&gt;
Log out.&lt;br /&gt;
&lt;br /&gt;
Log in as student who is enrolled in “Networks”.&lt;br /&gt;
&lt;br /&gt;
Go to the course and click on “New 360 Feedback”.&lt;br /&gt;
&lt;br /&gt;
This will bring user to the home page of the tool, which is “Activity”.&lt;br /&gt;
&lt;br /&gt;
At this point clicking on “Respondents” or “Reports” will display no information as nothing is completed yet.&lt;br /&gt;
&lt;br /&gt;
In the “Activity” section, student can see only his/her own profile.&lt;br /&gt;
&lt;br /&gt;
There is “Self” and “Job Profile” with option to “View” against each of them.&lt;br /&gt;
&lt;br /&gt;
First, we click “View” for “Self” profile.&lt;br /&gt;
&lt;br /&gt;
This will bring form with label “Network Administration” (which is the name of competency we have created earlier).&lt;br /&gt;
&lt;br /&gt;
Inside the form we can see skills that we entered earlier listed with 5 radio buttons beside each of them.&lt;br /&gt;
&lt;br /&gt;
These buttons allows to supply rating on scale 1-5.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s mark “Install and configure small network” as 5 and “Troubleshoot Network” as 4.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
At the “Activity” section we can see that table now displaying “Date Completed”.&lt;br /&gt;
&lt;br /&gt;
Clicking “View” will bring us back to the evaluation page, but we will not be able to amend any information on it, only view.&lt;br /&gt;
&lt;br /&gt;
Next, click on “Respondents”. It will bring form which allows to invite respondents by entering respondent&#039;s e-mail address and specifying the type of respondent.&lt;br /&gt;
&lt;br /&gt;
For this example, we invite 2 respondents:&lt;br /&gt;
&lt;br /&gt;
tania.roche.tr@gmail.com as “peer”&lt;br /&gt;
&lt;br /&gt;
tania.roche@enovation.ie as “peer”&lt;br /&gt;
&lt;br /&gt;
Next, we check e-mail address tania.roche@enovation.ie, open the message and click on the link inside the message. It will bring us to review form. On the top of the form we can see greeting message, which is confirming identity of respondent by displaying e-mail address and also states who&#039;s review it is.&lt;br /&gt;
&lt;br /&gt;
For this example, we will mark “Install and configure small network” as 4 and “Troubleshoot Network” as 3. This is a bit lower than student rated herself.&lt;br /&gt;
&lt;br /&gt;
Click “Finish”.&lt;br /&gt;
&lt;br /&gt;
We should see confirmation message:&lt;br /&gt;
&lt;br /&gt;
“Thank you for assessing this user.&lt;br /&gt;
&lt;br /&gt;
You may now close this window.”&lt;br /&gt;
&lt;br /&gt;
Next we check e-mail address tania.roche.tr@gmail.com and perform all the same steps, but we will mark “Install and configure small network” as 3 and “Troubleshoot Network” as 2. Even lower than previous 2 reviews (this is just to give some range for testing purposes).&lt;br /&gt;
&lt;br /&gt;
Now if we go to &#039;&#039;&#039;“Respondents”&#039;&#039;&#039; section and choose this student, we will see the “Completion Date” in the table showing the date when respondents completed the review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This section is displaying reports based on the evaluation data.&lt;br /&gt;
&lt;br /&gt;
It is possible to configure report using filters. To do so, just select tick-boxes that correspond to the options you wish to display in the table/chart.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Apply&amp;quot; and report will be generated displaying evaluation information about selected user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logged in as admin, we can see settings block showing.&lt;br /&gt;
&lt;br /&gt;
* Edit settings&lt;br /&gt;
&lt;br /&gt;
* Locally assigned roles&lt;br /&gt;
&lt;br /&gt;
* Permissions&lt;br /&gt;
&lt;br /&gt;
* Check permissions&lt;br /&gt;
&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
&lt;br /&gt;
* Backup&lt;br /&gt;
&lt;br /&gt;
* Restore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit settings:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Clicking on this option allows to edit the following settings of 360 Feedback tool: Name, Competencies carried, number of required respondents, group mode (No Groups, Separate Groups, Visible Groups), visibility (show/hide) and ID number.&lt;br /&gt;
&lt;br /&gt;
Note: ID number is only needed if this 360 Feedback will be used in grading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Locally assigned roles:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Allows to assign following roles locally (teacher, non-editing teacher and student).&lt;br /&gt;
&lt;br /&gt;
When clicking on any of those options, list of users enrolled in this course is displayed. We can then assign roles as needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option lists all the capabilities associated with this 360 Feedback tool. Each capability has roles associated with it. For example, “Delete external respondents from a user&#039;s list” has Non-editing teacher, Teacher and Manager associated with it. It means that anyone who has one of those roles, can delete external respondents from user&#039;s list.&lt;br /&gt;
&lt;br /&gt;
There is also option to define role or roles that is prohibited to perform the action.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; there is column called “Risks” which is displaying icons representing various security risks associated with changing default permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check permissions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to see what kind of permissions any particular user has in this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Currently there are two filters “Activity names atuo-linking” and “Multimedia Plugins”. Both filters are “On” by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to view report of activities performed on this 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
It is highly configurable with the following options present:&lt;br /&gt;
&lt;br /&gt;
Course name – allows to choose the course&lt;br /&gt;
&lt;br /&gt;
Participants – allows to choose “All” or specify particular participant.&lt;br /&gt;
&lt;br /&gt;
Date - “All days” or choose other date available.&lt;br /&gt;
&lt;br /&gt;
Module – can choose any, for example, forum or 360 Feedback module.&lt;br /&gt;
&lt;br /&gt;
Actions – can choose “All actions”,  “View”, “Add”, “Update”, “Delete”,  “All changes”.&lt;br /&gt;
&lt;br /&gt;
Format of displaying - “Display on page”, “Download in text format”, “Download in ODT format”, “Download in Excel format”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to backup 360 Feedback module and information associated with it. However, it is possible to choose which information to backup and which not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This option allows to restore previously saved 360 Feedback module and information associated with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:https://docs.moodle.org/24/en/File:360_screen1.jpg]]&lt;/div&gt;</summary>
		<author><name>Enovationdevteam</name></author>
	</entry>
</feed>