Skip to content

Instantly share code, notes, and snippets.

@camilojm27
Last active March 23, 2021 22:06
Show Gist options
  • Save camilojm27/a5b9bc9c6789e47caa9c16d4b90f542a to your computer and use it in GitHub Desktop.
Save camilojm27/a5b9bc9c6789e47caa9c16d4b90f542a to your computer and use it in GitHub Desktop.
Script para instalar los plugins que se utilizan en el CVUV, cambiar la variable dirpath con la dirección de la carpeta moodle
import subprocess, os
#subprocess.run(["ls", "-l"])
dirpath = '/var/www/html/moodle38'
#dirpath = '/home/camilo/Projects/DINTEV/TEST'
#blocks
blocks = ['/blocks/',
'git clone --branch master https://github.com/desarrolloant/course_list.git course_list',
'git clone --branch master https://github.com/jonof/moodle-block_completion_progress.git completion_progress',
'git clone --branch MOODLE_36_STABLE https://github.com/jleyva/moodle-block_configurablereports.git configurable_reports',
'git clone --branch dev https://github.com/marxjohnson/moodle-block_messageteacher.git messageteacher',
'git clone --branch master https://github.com/deraadt/moodle-block_simple_clock.git simple_clock',
]
#Mod
#hvp se baja en la linea 71
mod = [
'/mod/',
'git clone --branch main https://github.com/danmarsden/moodle-mod_attendance.git attendance',
'git clone --branch master https://github.com/davosmith/moodle-checklist.git checklist',
'git clone --branch master https://github.com/ndunand/moodle-mod_choicegroup.git choicegroup',
'git clone --branch MOODLE_20_STABLE https://github.com/bdaloukas/moodle-mod_game.git game',
'git clone --branch master https://github.com/projectestac/moodle-mod_geogebra.git geogebra',
'git clone --branch master https://github.com/gbateson/moodle-mod_hotpot.git hotpot',
'git clone --branch master https://github.com/elearningsoftware/moodle-mod_journal.git journal',
'git clone --branch master https://github.com/netspotau/moodle-mod_lightboxgallery.git lightboxgallery',
'git clone --branch MOODLE_39_STABLE https://github.com/PoetOS/moodle-mod_questionnaire.git questionnaire',
'git clone --branch master https://github.com/lucaboesch/moodle-quizaccess_safeexambrowser.git /quiz/safeexambrowser'
]
lib = [
'/lib/editor/',
'git clone --branch master https://github.com/dthies/moodle-atto_cloze.git /atto/plugins/cloze',
'git clone --branch master https://github.com/dthies/moodle-atto_fullscreen.git /atto/plugins/fullscreen',
'git clone --branch master https://github.com/moodle-ead/atto_justify.git /atto/plugins/justify',
'git clone --branch master https://github.com/ndunand/moodle-atto_morebackcolors.git /atto/plugins/morebackcolors',
'git clone --branch master https://github.com/ndunand/moodle-atto_morefontcolors.git /atto/plugins/morefontcolors',
'git clone --branch stable https://github.com/wiris/moodle-atto_wiris.git /atto/plugins/wiris',
'git clone --branch v3.8r03 https://github.com/germanvaleroelizondo/moodle-tinymce_clozeeditor.git /tinymce/plugins/clozeeditor',
]
course = [
'/course/format/',
'git clone --branch master https://github.com/davidherney/moodle-format_onetopic.git onetopic',
'git clone --branch master https://github.com/brandaorodrigo/moodle-format_buttons.git buttons',
]
question = [
'/question/type/',
'git clone --branch master https://github.com/ethz-let/moodle-qtype_kprime.git kprime']
filter = [
'/filter/',
'git clone --branch master https://github.com/wiris/moodle-filter_wiris.git wiris']
local = [
'/local/',
'git clone --branch master https://github.com/desarrolloant/deleteoldcourses.git deleteoldcourses']
commnads = [blocks, mod,lib, course, question, filter, local]
def get_command(array):
localpath = dirpath + array.pop(0)
while array:
com = array.pop(0).split()
com.append(localpath + com.pop())
subprocess.Popen(com)
def executor():
os.system(
'git clone --branch stable https://github.com/h5p/moodle-mod_hvp.git {}/mod/hvp'.format(dirpath))
os.system(
'cd {}/mod/hvp && git submodule update --init'.format(dirpath))
while(commnads):
get_command(commnads.pop())
executor()
print('DONE\n')
import subprocess, os
#subprocess.run(["ls", "-l"])
dirpath = '/var/www/html/moodle'
#dirpath = '/home/camilo/Projects/DINTEV/TEST'
#blocks
blocks = ['/blocks/',
'git clone --branch master https://github.com/desarrolloant/course_list.git course_list',
'git clone --branch master https://github.com/jonof/moodle-block_completion_progress.git completion_progress',
'git clone --branch MOODLE_36_STABLE https://github.com/jleyva/moodle-block_configurablereports.git configurable_reports',
'git clone --branch dev https://github.com/marxjohnson/moodle-block_messageteacher.git messageteacher',
'git clone --branch master https://github.com/deraadt/moodle-block_simple_clock.git simple_clock',
]
#Mod
mod = [
'/mod/',
'git clone --branch main https://github.com/danmarsden/moodle-mod_attendance.git attendance',
'git clone --branch MOODLE_38_STABLE https://github.com/davosmith/moodle-checklist.git checklist',
'git clone --branch master https://github.com/ndunand/moodle-mod_choicegroup.git choicegroup',
'git clone --branch MOODLE_20_STABLE https://github.com/bdaloukas/moodle-mod_game.git game',
'git clone --branch MOODLE_38_STABLE https://github.com/projectestac/moodle-mod_geogebra.git geogebra',
'git clone --branch master https://github.com/gbateson/moodle-mod_hotpot.git hotpot',
'git clone --branch master https://github.com/elearningsoftware/moodle-mod_journal.git journal',
'git clone --branch master https://github.com/netspotau/moodle-mod_lightboxgallery.git lightboxgallery',
'git clone --branch MOODLE_39_STABLE https://github.com/PoetOS/moodle-mod_questionnaire.git questionnaire',
'git clone --branch master https://github.com/lucaboesch/moodle-quizaccess_safeexambrowser.git /quiz/safeexambrowser'
]
lib = [
'/lib/editor/',
'git clone --branch master https://github.com/dthies/moodle-atto_cloze.git /atto/plugins/cloze',
'git clone --branch master https://github.com/dthies/moodle-atto_fullscreen.git /atto/plugins/fullscreen',
'git clone --branch master https://github.com/moodle-ead/atto_justify.git /atto/plugins/justify',
'git clone --branch master https://github.com/ndunand/moodle-atto_morebackcolors.git /atto/plugins/morebackcolors',
'git clone --branch master https://github.com/ndunand/moodle-atto_morefontcolors.git /atto/plugins/morefontcolors',
'git clone --branch stable https://github.com/wiris/moodle-atto_wiris.git /atto/plugins/wiris',
'git clone --branch v3.8r03 https://github.com/germanvaleroelizondo/moodle-tinymce_clozeeditor.git /tinymce/plugins/clozeeditor',
]
course = [
'/course/format/',
'git clone --branch MOODLE_33 https://github.com/davidherney/moodle-format_onetopic.git onetopic',
'git clone --branch master https://github.com/brandaorodrigo/moodle-format_buttons.git buttons',
]
question = [
'/question/type/',
'git clone --branch master https://github.com/ethz-let/moodle-qtype_kprime.git kprime']
filter = [
'/filter/',
'git clone --branch master https://github.com/wiris/moodle-filter_wiris.git wiris']
local = [
'/local/',
'git clone --branch master https://github.com/desarrolloant/deleteoldcourses.git deleteoldcourses']
commnads = [blocks, mod,lib, course, question, filter, local]
def get_command(array):
localpath = dirpath + array.pop(0)
while array:
com = array.pop(0).split()
com.append(localpath + com.pop())
subprocess.Popen(com)
def executor():
os.system(
'git clone --branch stable https://github.com/h5p/moodle-mod_hvp.git {}/mod/hvp'.format(dirpath))
os.system(
'cd {}/mod/hvp && git submodule update --init'.format(dirpath))
while(commnads):
get_command(commnads.pop())
executor()
print('DONE\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment