Skip to content

Instantly share code, notes, and snippets.

@jleyva
jleyva / externallib.php
Created April 16, 2012 08:12
Part of external lib
<?php
/**
* Returns description of method parameters
* @return external_function_parameters
*/
public static function duplicate_course_parameters() {
return new external_function_parameters(
array(
'courseid' => new external_value(PARAM_INT, 'course to duplicate id'),
@jleyva
jleyva / externallib.php
Created April 17, 2012 07:36
core_course_get_categories
<?php
/**
* Returns description of method parameters
*
* @return external_function_parameters
* @since Moodle 2.3
*/
public static function get_categories_parameters() {
@jleyva
jleyva / groupings_test.php
Created April 30, 2012 15:11
Groupings test
<?php
// This client for local_illl 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.
//
/**
* XMLRPC client for Moodle 2 - local_illl
*
@jleyva
jleyva / locallib.php
Last active December 19, 2015 01:28
Assinglib para funcionar con uploadgroup mod/assign/submission/file/locallib.php
/**
* Return true if this plugin can upgrade an old Moodle 2.2 assignment of this type
* and version.
*
* @param string $type
* @param int $version
* @return bool True if upgrade is possible
*/
public function can_upgrade($type, $version) {
@jleyva
jleyva / client.php
Created September 23, 2013 12:29
Testing core_user_add_user_device
<?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.
//
/**
#!/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
@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
@jleyva
jleyva / client.php
Created February 6, 2014 11:14
PHP Client for testing MDL-44020
<?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.
//
/**
* REST client for Moodle 2
@jleyva
jleyva / client_forum_get_posts.php
Last active August 29, 2015 13:57
Test client for forum_get_posts MDL-30106
<?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.
//
/**
@jleyva
jleyva / client_forum_get_discussions.php
Created March 4, 2014 15:10
client_forum_get_discussions MDL-44408
<?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.
//
/**