ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/user/amd/src/repository.js000064400000013225152266362250023760 0ustar00// This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . /** * Module to handle AJAX interactions. * * @module core_user/repository * @copyright 2020 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ import Config from 'core/config'; import {call as fetchMany} from 'core/ajax'; import Fetch from 'core/fetch'; const checkUserId = (userid) => { if (Number(userid) === 0) { return; } if (Number(userid) === Config.userId) { return; } throw new Error( `Invalid user ID: ${userid}. It is only possible to manage preferences for the current user.`, ); }; /** * Turn the response object into a Proxy object that will log a warning if the saved property is accessed. * * @param {Object} response * @param {Object} preferences The preferences that might be in the response * @return {Promise} */ const addLegacySavedProperty = (response, preferences) => { const debugLogger = { get(target, prop, receiver) { if (prop === 'then') { // To proxy a Promise we have to return null when the then key is requested. return null; } if (prop === 'saved') { window.console.warn( 'The saved property is deprecated. Please use the response object directly.', ); return preferences .filter((preference) => target.hasOwnProperty(preference.name)) .map((preference) => ({ name: preference.name, userid: Config.userid, })); } return Reflect.get(target, prop, receiver); }, }; return Promise.resolve(new Proxy(response, debugLogger)); }; /** * Get single user preference * * @param {String} name Name of the preference * @param {Number} userid User ID (defaults to current user) * @return {Promise} */ export const getUserPreference = (name, userid = 0) => getUserPreferences(name, userid) .then((response) => response[name]); /** * Get multiple user preferences * * @param {String|null} name Name of the preference (omit if you want to retrieve all) * @param {Number} userid User ID (defaults to current user) * @return {Promise>} */ export const getUserPreferences = (name = null, userid = 0) => { checkUserId(userid); const endpoint = ['current', 'preferences']; if (name) { endpoint.push(name); } return Fetch.performGet('core_user', endpoint.join('/')).then((response) => response.json()); }; /** * Set single user preference * * @param {String} name Name of the preference * @param {String|null} value Value of the preference (omit if you want to remove the current value) * @param {Number} userid User ID (defaults to current user) * @return {Promise} */ export const setUserPreference = (name, value = null, userid = 0) => { checkUserId(userid); return Fetch.performPost( 'core_user', `current/preferences/${name}`, { body: {value}, }, ) // Return the result of the fetch call, and also add in the legacy saved property. .then((response) => response.json()) .then((response) => addLegacySavedProperty(response, [{name}])); }; /** * Set multiple user preferences * * @param {Object[]} preferences Array of preferences containing name/value/userid attributes * @return {Promise} */ export const setUserPreferences = (preferences) => { preferences.forEach((preference) => checkUserId(preference.userid)); return Fetch.performPost( 'core_user', 'current/preferences', { body: { preferences: Object.fromEntries (preferences.map((preference) => ([preference.name, preference.value]))), }, }, ) // Return the result of the fetch call, and also add in the legacy saved property. .then((response) => response.json()) .then((response) => addLegacySavedProperty(response, preferences)); }; /** * Unenrol the user with the specified user enrolmentid ID. * * @param {Number} userEnrolmentId * @return {Promise} */ export const unenrolUser = userEnrolmentId => { return fetchMany([{ methodname: 'core_enrol_unenrol_user_enrolment', args: { ueid: userEnrolmentId, }, }])[0]; }; /** * Submit the user enrolment form with the specified form data. * * @param {String} formdata * @return {Promise} */ export const submitUserEnrolmentForm = formdata => { return fetchMany([{ methodname: 'core_enrol_submit_user_enrolment_form', args: { formdata, }, }])[0]; }; export const createNotesForUsers = notes => { return fetchMany([{ methodname: 'core_notes_create_notes', args: { notes } }])[0]; }; export const sendMessagesToUsers = messages => { return fetchMany([{ methodname: 'core_message_send_instant_messages', args: {messages} }])[0]; }; home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/cohort/amd/src/repository.js000064400000002543152266535150024302 0ustar00// This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . /** * Module to handle cohort AJAX requests. * * @module core_cohort/repository * @copyright 2024 David Woloszyn * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ import Ajax from 'core/ajax'; /** * Delete single cohort. * * @param {Number} cohortid * @return {Promise} */ export const deleteCohort = cohortid => deleteCohorts([cohortid]); /** * Delete multiple cohorts. * * @param {Number[]} cohortids * @return {Promise} */ export const deleteCohorts = cohortids => { const request = { methodname: 'core_cohort_delete_cohorts', args: {cohortids}, }; return Ajax.call([request])[0]; }; home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/course/amd/src/repository.js000064400000014614152266536070024310 0ustar00// This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . /** * A javascript module to handle course ajax actions. * * @module core_course/repository * @copyright 2018 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ import Ajax from 'core/ajax'; /** * Get the list of courses that the logged in user is enrolled in for a given * timeline classification. * * @param {string} classification past, inprogress, or future * @param {int} limit Only return this many results * @param {int} offset Skip this many results from the start of the result set * @param {string} sort Column to sort by and direction, e.g. 'shortname asc' * @return {object} jQuery promise resolved with courses. */ const getEnrolledCoursesByTimelineClassification = (classification, limit, offset, sort) => { const args = { classification: classification }; if (typeof limit !== 'undefined') { args.limit = limit; } if (typeof offset !== 'undefined') { args.offset = offset; } if (typeof sort !== 'undefined') { args.sort = sort; } const request = { methodname: 'core_course_get_enrolled_courses_by_timeline_classification', args: args }; return Ajax.call([request])[0]; }; /** * Get a list of courses that the logged in user is enrolled in, where they have at least one action event, * for a given timeline classification. * * @param {string} classification past, inprogress, or future * @param {int} limit The maximum number of courses to return * @param {int} offset Skip this many results from the start of the result set * @param {string} sort Column to sort by and direction, e.g. 'shortname asc' * @param {string} searchValue Optional text search value * @param {int} eventsFrom Optional start timestamp (inclusive) that the course should have event(s) in * @param {int} eventsTo Optional end timestamp (inclusive) that the course should have event(s) in * @return {object} jQuery promise resolved with courses. */ const getEnrolledCoursesWithEventsByTimelineClassification = (classification, limit = 0, offset = 0, sort = null, searchValue = null, eventsFrom = null, eventsTo = null) => { const args = { classification: classification, limit: limit, offset: offset, sort: sort, eventsfrom: eventsFrom, eventsto: eventsTo, searchvalue: searchValue, }; const request = { methodname: 'core_course_get_enrolled_courses_with_action_events_by_timeline_classification', args: args }; return Ajax.call([request])[0]; }; /** * Get the list of courses that the user has most recently accessed. * * @method getLastAccessedCourses * @param {int} userid User from which the courses will be obtained * @param {int} limit Only return this many results * @param {int} offset Skip this many results from the start of the result set * @param {string} sort Column to sort by and direction, e.g. 'shortname asc' * @return {promise} Resolved with an array of courses */ const getLastAccessedCourses = (userid, limit, offset, sort) => { const args = {}; if (typeof userid !== 'undefined') { args.userid = userid; } if (typeof limit !== 'undefined') { args.limit = limit; } if (typeof offset !== 'undefined') { args.offset = offset; } if (typeof sort !== 'undefined') { args.sort = sort; } const request = { methodname: 'core_course_get_recent_courses', args: args }; return Ajax.call([request])[0]; }; /** * Get the list of users enrolled in this cmid. * * @param {Number} cmid Course Module from which the users will be obtained * @param {Number} groupID Group ID from which the users will be obtained * @param {Boolean} onlyActive Whether to fetch only the active enrolled users or all enrolled users in the course. * @returns {Promise} Promise containing a list of users */ const getEnrolledUsersFromCourseModuleID = (cmid, groupID, onlyActive = false) => { var request = { methodname: 'core_course_get_enrolled_users_by_cmid', args: { cmid: cmid, groupid: groupID, onlyactive: onlyActive, }, }; return Ajax.call([request])[0]; }; /** * Get the list of gradable users enrolled in this course. * * @param {Number} courseid Course ID from which the users will be obtained * @param {Number} groupID Group ID from which the users will be obtained * @param {Boolean} onlyActive Whether to fetch only the active enrolled users or all enrolled users in the course. * @returns {Promise} Promise containing a list of users */ const getGradabaleUsersFromCourseID = (courseid, groupID, onlyActive = false) => { const request = { methodname: 'core_grades_get_gradable_users', args: { courseid: courseid, groupid: groupID, onlyactive: onlyActive, }, }; return Ajax.call([request])[0]; }; /** * Toggle the completion state of an activity with manual completion. * * @param {Number} cmid The course module ID. * @param {Boolean} completed Whether to set as complete or not. * @returns {object} jQuery promise */ const toggleManualCompletion = (cmid, completed) => { const request = { methodname: 'core_completion_update_activity_completion_status_manually', args: { cmid, completed, } }; return Ajax.call([request])[0]; }; export default { getEnrolledCoursesByTimelineClassification, getLastAccessedCourses, getUsersFromCourseModuleID: getEnrolledUsersFromCourseModuleID, getGradableUsersFromCourseID: getGradabaleUsersFromCourseID, toggleManualCompletion, getEnrolledCoursesWithEventsByTimelineClassification, }; home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/grade/amd/src/searchwidget/repository.js000064400000004003152266632570026534 0ustar00// This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . /** * A repo for the search widget. * * @module core_grades/searchwidget/repository * @copyright 2022 Mathew May * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ import ajax from 'core/ajax'; /** * Given a course ID, we want to fetch the gradable items, so we may fetch reports based on activity items. * Note: This will be worked upon in the single view issue. * * @method gradeitemFetch * @param {int} courseid ID of the course to fetch the users of. * @return {object} jQuery promise */ export const gradeitemFetch = (courseid) => { const request = { methodname: 'gradereport_singleview_get_grade_items_for_search_widget', args: { courseid: courseid, }, }; return ajax.call([request])[0]; }; /** * Given a course ID, we want to fetch the enrolled learners, so we may fetch their reports. * * @method userFetch * @param {int} courseid ID of the course to fetch the users of. * @param {int} groupId ID of the group to fetch the users of. * @return {object} jQuery promise */ export const userFetch = (courseid, groupId) => { const request = { methodname: 'core_grades_get_enrolled_users_for_selector', args: { courseid: courseid, groupid: groupId, }, }; return ajax.call([request])[0]; }; home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/mod/lti/amd/src/repository.js000064400000002615152267105400024343 0ustar00// This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . /** * Module to handle AJAX interactions. * * @module mod_lti/repository * @copyright 2023 Ilya Tregubov * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ import Ajax from 'core/ajax'; /** * Toggle coursevisible of a tool * * @param {Number} tooltypeid Too type id * @param {Number} courseid Course ID * @param {Number} showinactivitychooser showinactivitychooser state * @return {Promise} */ export const toggleShowInActivityChooser = ( tooltypeid, courseid, showinactivitychooser, ) => Ajax.call([{ methodname: 'mod_lti_toggle_showinactivitychooser', args: { tooltypeid, courseid, showinactivitychooser, }, }])[0]; home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/h5p/amd/src/repository.js000064400000005264152267433460023505 0ustar00// This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . /** * Module to handle AJAX interactions. * * @module core_h5p/repository * @copyright 2023 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ import {call as fetchMany} from 'core/ajax'; import * as config from 'core/config'; /** * Send a xAPI statement to LMS. * * @param {string} component * @param {Object} statements * @returns {Promise} */ export const postStatement = (component, statements) => fetchMany([{ methodname: 'core_xapi_statement_post', args: { component, requestjson: JSON.stringify(statements), } }])[0]; /** * Send a xAPI state to LMS. * * @param {string} component * @param {string} activityId * @param {Object} agent * @param {string} stateId * @param {string} stateData */ export const postState = ( component, activityId, agent, stateId, stateData, ) => { // Please note that we must use a Beacon send here. // The XHR is not guaranteed because it will be aborted on page transition. // https://developer.mozilla.org/en-US/docs/Web/API/Beacon_API // Note: Moodle does not currently have a sendBeacon API endpoint. const requestUrl = new URL(`${config.wwwroot}/lib/ajax/service.php`); requestUrl.searchParams.set('sesskey', config.sesskey); navigator.sendBeacon(requestUrl, JSON.stringify([{ index: 0, methodname: 'core_xapi_post_state', args: { component, activityId, agent: JSON.stringify(agent), stateId, stateData, } }])); }; /** * Delete a xAPI state from LMS. * * @param {string} component * @param {string} activityId * @param {Object} agent * @param {string} stateId * @returns {Promise} */ export const deleteState = ( component, activityId, agent, stateId, ) => fetchMany([{ methodname: 'core_xapi_delete_state', args: { component, activityId, agent: JSON.stringify(agent), stateId, }, }])[0]; home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/ai/amd/src/repository.js000064400000002756152267723350023405 0ustar00// This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . /** * AI Subsystem policy functions. * * @module core_ai/repository * @copyright Matt Porritt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 4.5 */ import Ajax from 'core/ajax'; /** * Get the policy status for a user. * * @param {Number} userid The user ID. * @return {Promise} The policy status. */ export const getPolicyStatus = (userid) => Ajax.call([{ methodname: 'core_ai_get_policy_status', args: {userid}, }])[0]; /** * Set the policy status for a user. * * @param {Number} contextId The context ID. * @return {Promise} Promise resolved with the policy set status. */ export const setPolicyStatus = (contextId) => Ajax.call([{ methodname: 'core_ai_set_policy_status', args: {contextid: contextId}, }])[0];