Created
August 8, 2019 22:24
-
-
Save horaciod/2d2fb2cf28a34c485b0e01faa132d0f7 to your computer and use it in GitHub Desktop.
moodle enroll all students from on course to another using moosh https://moosh-online.com/commands/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# dos parámetros / two parameters | |
# ex. ./enrolldecurso_a_curso.sh --id 20 715 | |
# $1 curso orign $2 curso destino | |
# ### path of the moodle root | |
cd /datos/webs/moodle36/html | |
#export curso | |
php /home/desarrollo/moosh/moosh.php user-list --course=$1 --id >/tmp/exportados.txt | |
#exit 111 | |
echo '---------------------'; | |
for i in `cat /tmp/exportados.txt` | |
do | |
# echo '-----------------------' >> /home/desarrollo/enrollinfo.txt; | |
echo "Course ID destino : $2 enroll al user $i" ; | |
php /home/desarrollo/moosh/moosh.php course-enrol --id $2 $i | |
done | |
cat /home/desarrollo/enrollinfo.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment