Skip to content

Instantly share code, notes, and snippets.

@jleyva
jleyva / iframetoplocationhref.html
Created November 10, 2023 09:22
Redirect to launch moodlemobile custom url scheme via parent of iframe
<!DOCTYPE html>
<html>
<head>
<title>Redirect Page</title>
<script>
// Define the target URL
var targetURL = 'moodlemobile://link=https://master.mm.moodledemo.net/course/view.php?id=14';
// Function to redirect the parent window
function redirectParent() {
@jleyva
jleyva / futurelib.php
Created December 8, 2016 10:39
check_updates backport local_mobile
require_once($CFG->dirroot . '/course/lib.php');
if (!function_exists('course_check_updates')) {
/**
* Check for course updates in the given context level instances (only modules supported right Now)
*
* @param stdClass $course course object
* @param array $tocheck instances to check for updates
* @param array $filter check only for updates in these areas
@jleyva
jleyva / services.php
Created March 10, 2016 11:04
mod/quiz/db/services.php
<?php
// 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
@jleyva
jleyva / external.php
Created March 10, 2016 11:03
mod/quiz/external.php
<?php
// 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
@jleyva
jleyva / moodlemobileapp.css
Last active April 20, 2024 12:52
moodlemobileapp.css advanced
.bar-header {
background-color: #5069A1;
}
ion-side-menu li .item {
background-color: #313848;
border-color: #4F5865;
color: #BCC3CF;
}
@jleyva
jleyva / forcesendgrades.php
Last active January 13, 2016 13:14
forcesendgrades.php
<?php
// 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
@jleyva
jleyva / scorm.js
Last active November 25, 2015 12:05
/**
* Check if the given SCORM is available (time restrictions).
* The remote Web Service check that, but if we are offline maybe we have passed the timeclose date.
*/
isAvailable = function(scorm) {
var timeNow = $mmUtil.timestamp();
if (scorm.timeopen > 0 && scorm.timeopen > timeNow) {
return false;
}
@jleyva
jleyva / mm.css
Created June 22, 2015 09:57
Moodle Mobile 2 remote CSS
.bar-side-menu {
background-color: blue;
}
.bar-content {
background-color: blue;
}
.button.button-positive {
border-color: blue;
@jleyva
jleyva / core_message_get_blocked_users.php
Last active August 29, 2015 14:13
core_message_get_blocked_users
<?php
// message/externallib.php
/**
* Retrieve a list of users blocked
*
* @param int $userid the user whose blocked users we want to retrieve
* @return external_description
* @since 2.9
*/
@jleyva
jleyva / cors.html
Created October 6, 2014 21:38
MDL-47545
<html>
<head>
<script language="javascript">
function test() {
var siteURL = document.getElementById("url").value;
var token = document.getElementById("token").value;
var data = {
"wsfunction": "moodle_webservice_get_siteinfo",
"wstoken": token