Can't upload Record Audio file in Moodle 2.9

Can't upload Record Audio file in Moodle 2.9

by Eduardo Hm -
Number of replies: 7
Hi,

I'm testing this new repository  "Record Audio" for Moodle 2.9. I have installed without problem. I have enabled management repositories. I made a test within a course, adding a file, and when I go to select a file and select the repository "Record Audio" I left with the message "Loading. Please wait" and the two buttons "Cancel" and "Upload" and stays there without being able to do more.

I tested
in all browsers and version that is running Flash Player is the latest.

Attached screenshot where you can see how it behaves.

What's missing?

Thank you


Attachment screenshot_193.jpg
Average of ratings: -
In reply to Eduardo Hm

Re: Can't upload Record Audio file in Moodle 2.9

by Paul Nicholls -

Hi Eduardo,

That usually happens when Flash Player can't access the microphone for some reason.  Assuming that your computer has a microphone either built in or plugged in (and enabled), your browser may also be blocking Flash from accessing the microphone; please check the top of the page and the address bar for any indication that microphone access has been blocked, and take any relevant action to allow your Moodle site access to the microphone.  Once the browser has granted permission, you may need to refresh the page in order to get Flash Player to recognise that it now has access to the microphone; you'll then be prompted within the recorder widget to allow access to your microphone within Flash Player.

If you still have trouble after granting microphone permission in both the browser and Flash Player, we'll need to dig a little deeper.


-Paul

In reply to Paul Nicholls

Re: Can't upload Record Audio file in Moodle 2.9

by Andre Dixon -

Hello Paul,

I have the record audio plugin in Moodle 2.6.  When I am logged in as a teacher and try to leave a file feedback for as assignment, the plugin gives me an error. After I have recorded the audio, enter the filename and click upload, I get the spinning image as seen below.


It never disappears and I look at bugzilla and see that there was a javascript error.

TypeError: data is null




I have been trying to debug this for about 5 hour now with no luck and would really appreciate your help.


Notes: THis moodle site does not allow private files so I was getting a permission error. To get pass this error, I added the following function to the lib.php

   public function contains_private_data() {

        return false;

    }










In reply to Andre Dixon

Re: Can't upload Record Audio file in Moodle 2.9

by Paul Nicholls -

Hi Andre,

I just tried it out on a Moodle 2.6 instance, and couldn't reproduce your issue.  Can you please clarify what you mean when you say that your Moodle site "does not allow private files"?  I followed the Moodle Docs instructions to disable private files on 2.6, and could still use the Record Audio repository to add assignment feedback files as a teacher, without needing to add the contains_private_data() function.

-Paul

In reply to Paul Nicholls

Re: Can't upload Record Audio file in Moodle 2.9

by Andre Dixon -

Hello Paul,

Below is a video I recorded so you can see the issue we are having.

I could do a screen sharing session at your convenience.

In reply to Andre Dixon

Re: Can't upload Record Audio file in Moodle 2.9

by Paul Nicholls -

Hi Andre,

I'm still unable to replicate the issue on my Moodle 2.6 instance.  The difference in returned data between the first and second attempt with the same file name is expected, and all looks fine.  The permission error that you were getting before you added the contains_private_data method makes me suspect that it's related to the way you've disabled private files.  Can you please confirm whether you've simply followed the instructions in the docs, or if something further has been done to disable private files? 

In reply to Paul Nicholls

Re: Can't upload Record Audio file in Moodle 2.9

by Andre Dixon -

Hello Paul,

After digging around for a bit. I realized that the issue is actually an issue in the filepicker.js found in /reposiory.
It tries to parse the response which is totally valid json but for some reason, is not parsing the numeric values.


Here is the error caught with a try block

JSON.parse: unexpected character at line 1 column 95 of the JSON data

 and here is what is tries to parse.

{"url": "http://aum26.localhost/draftfile.php/5/user/draft/429992676/new_recording.mp","id": ​429992676,"file": "new_recording.mp3"}

As you can see, it is valid json. To get around the issue, I output the ID as a string and not a int.


To do this, I adjusted lone 183 in lib.php from

                'id'=>$record->itemid,    

to

                'id'=>"$record->itemid", 



In reply to Eduardo Hm

Re: Can't upload Record Audio file in Moodle 2.9

by Andre Dixon -

Hello Paul,

While doing some testing between Moodle 2.6 and Moodle 3.1, I discovered an bug with regards to the assignment audio submission and the submission reopen feature.

I noted it in the github bug tracker for the plugin but will still explain here.


Issue:

Student are unable to submit an assignment with a audio recording if the assignment was previously reopened.


How to produce bug:

  1. Create an assignment with submission type of "Online audio recording" and under "Submission Settings", "attempts reopened" to "Manually".
  2. With student A, save an submit an audio recording.
  3. As teacher, reopen submission by click "allow another attempt" for submission under the record edit menu in the grading table.
  4. As student A, go to the assignment review page and click "Add a new attempt".
  5. As student A, try to record and save an audio record. The page will only refresh after clicking save but no audio file will be show. Instead, the student will be brought page to records audio.


If the student was to go back to the assignment review pages, (s)he would realize that all the tries (s)he has made to records a new audio for the current attempt are now stored (associated) with the previous attempt as seen in the image below,