With Moosh, i'm trying to link an uploaded zip file to a scorm activity previously created with Moosh.
May be than this goal can be done in one Moosh command (activity creation + upload file + link file to activity) or severals Moosh commands, i don't know.
I develop scorm packages containing serious-games and I would like to automate the upload of my zip file on moodle to be available as a scorm activity.
Os: Ubuntu (i use lampp for web server)
Lampp php version: 7.2.6
Moodle version: 3.5
Next, i upload my zip file:
sudo /opt/lampp/bin/php-7.2.6 /opt/lampp/htdocs/moosh/moosh.php -n -p /opt/lampp/htdocs/moodle/ file-upload ~/Téléchargements/sc1.zip
The file is uploaded in directory: /usr/local/moodledata/filedir/ and renamed with a hash.
But i don't know how to link my zip file to my scorm activity with Moosh.
I have tried to add this option (find here: https://moodle.org/mod/forum/discuss.php?d=368091#p1495239):
In the previous activity-add command, like that:
/opt/lampp/bin/php-7.2.6 /opt/lampp/htdocs/moosh/moosh.php -n -p /opt/lampp/htdocs/moodle/ activity-add --name="mooshScormTest" --section="1" --options='packagefile="~/Téléchargements/sc1.zip", intro="activity name", --forcenewattempt=1'
But that doesn't works.
I have looked in Moodle data base, the files table mdl_files, to may be find a table field which is "file id", and write this file id in the activity-add in his packagefile option, i have tried with fields: itemid, contenthash and pathnamehash, but that doesn't works.
If you have any idea for create the scorm activity with zip file, thank for you help.