OppiaMobile Community

Moodle Export Update

Hi @alex
I recently updated both the server and the moodle export block to the latest versions.
I am trying to export a course with media to the staging server that I set up. I am getting an error. (I have increased the php upload size but am still getting an error.)
I have attached the error files.
Screenshot_2021-01-27 Course Continuity Of Essential Health Services During The Covid-19 Pandemic Unit TWO Priority essenti...

Here is the apache error log for oppia:-
[Wed Jan 27 15:08:05.277218 2021] [wsgi:error] [pid 1715] setattr(self, attr, getattr(obj, attr))
[Wed Jan 27 15:08:05.277446 2021] [wsgi:error] [pid 1715] /home/oppia/env/lib/python3.6/site-packages/sorl/thumbnail/conf/init.py:16: RemovedInDjango31Warning: The FILE_CHARSET setting is deprecated. Starting with Django 3.1, all files read from disk must be UTF-8 encoded.
[Wed Jan 27 15:08:05.277457 2021] [wsgi:error] [pid 1715] setattr(self, attr, getattr(obj, attr))
[Wed Jan 27 15:08:06.585812 2021] [wsgi:error] [pid 1715] [remote] /home/oppia/django-oppia/av/forms.py:69: ResourceWarning: unclosed file <_io.BufferedReader name=’/tmp/tmper_23py0.upload.m4v’>
[Wed Jan 27 15:08:06.585846 2021] [wsgi:error] [pid 1715] [remote] ‘rb’).read()).hexdigest()
[Wed Jan 27 15:08:07.067032 2021] [wsgi:error] [pid 1715] [remote] deleting …/home/oppia/media/uploaded/2021/01/PriorityEssentialHealthServices-Overview.m4v
[Wed Jan 27 15:08:07.078168 2021] [wsgi:error] [pid 1715] [remote] File removed
[Wed Jan 27 15:08:07.082700 2021] [wsgi:error] [pid 1715] [remote] Bad Request: /api/media/

Hi Hakim,
Not quite sure what’s going on here, but here are a few things that you could check…

  • Can you upload this same video file directly to the Oppia server - using the dashboard to upload the video file.
  • Are there any other video files that you;ve tried to upload? Or is it specifically only this video?
  • If this is new server, just check that the ffmpeg package is installed (see: Server - Manual Installation — OppiaMobile 0.12.13 documentation) - as this is used to analyse media content that is uploaded (eg to get the video length)

let me know how you get on with any of these,

Thanks, I had not installed the ffmpeg package on the new server (I copied over the whole oppia folder and database to the new server, so I had assumed all the packages wea installed as well)

@alex Maybe a follow up question, previously, I used to upload my video files in a folder outside the oppia directory. And I would use the media embed helper to generate the script used in moodle.
Following this update on the export block, Is there a way to specify a diffrent upload directory different from the default??

Yes you can change the upload directory, but you’d need to update the code base for this, see line 33 in av/models.py (django-oppia/models.py at master · DigitalCampus/django-oppia · GitHub) and change the upload_to parameter.

I’ve not specifically tested this out, and it might require a db migration, plus need to check the web server etc has write access and that it can serve up the media files from that dir (in the apache config). Think that should work.

Should add that you can change the whole Django ‘media’ folder to whereever you like - see the MEDIA_ROOT and MEDIA_URL options in the settings (django-oppia/settings.py at master · DigitalCampus/django-oppia · GitHub)

This will likely be much more reliable/easier than making specific Oppia code base changes.