Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / client_grades.php
Last active May 7, 2021 23:41
MDL-30085 core get _grades
<?php
// This file is NOT a part of Moodle - http://moodle.org/
//
// This client for Moodle 2 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.
//
/// SETUP - NEED TO BE CHANGED
<?php
// This file is NOT a part of Moodle - http://moodle.org/
//
// This client for Moodle 2 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.
//
/// SETUP - NEED TO BE CHANGED
@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 / 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 / fetch-langpacks.sh
Created January 28, 2014 15:29
Fetch language packs from Moodle for the mobile app and convert it to .json files
#!/bin/bash
# GIT FILE PATH
GIT_PATH="/Users/juanleyvadelgado/Documents/MoodleMobile/moodle-langpacks/moodle-langpacks"
BRANCH="MOODLE_26_STABLE"
# Minimun number of strings translated the language pack should have
LINES_MIN=170
cd $GIT_PATH
git checkout $BRANCH
git pull
#!/bin/bash
GIT_BASE=/Users/juanleyvadelgado/Documents/MoodleMobile/GIT
KEYSTORE=/Users/juanleyvadelgado/Documents/MoodleMobile/moodlemobile.keystore
EMAIL=mobile@cvaconsulting.com
rm MoodleMobile$1.apk
rm MoodleMobile$1Store.apk
rsync -a --exclude='.*' $GIT_BASE/ tmpdir/assets/www/
../apktool b tmpdir MoodleMobile$1.apk
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $KEYSTORE MoodleMobile$1.apk moodlemobile