PennController for IBEX › Forums › Support › uploadRecordingsError not working?
- This topic has 4 replies, 2 voices, and was last updated 3 years, 11 months ago by masato.
-
AuthorPosts
-
October 28, 2020 at 6:55 pm #6267masatoParticipant
Hi!
I am posting this because I wasn’t able to find a relevant existing post but sorry if there actually is!
I am trying to do a production experiment and want to make it so that participants can download the recordings and send it to us when there was a problem in the uploading process. I adopted the script in PennController.DownloadRecordingButton page in the documentation, but received the following error:
Unknown global PennController command: ‘uploadRecordingsError’ (PennController: 1)
The download button appears, but the message is different from the one defined in the script. I actually need to edit the message because my participants may not speak English.
I also tried the testing script in the same page of the documentation but it also failed, and the error message did not follow the script. Could you let me know how to solve this issue?
Thank you so much!
Masato
October 29, 2020 at 11:47 am #6270JeremyKeymasterHi Masato,
Recent versions of PennController automatically insert a page inviting to download an archive containing the MediaRecorder samples in case the upload failed. It could explain why the message you see is different from what you expect; it also makes the use of DownloadRecordingButton redundant in this case
As with other texts in PennController, I have not yet implemented a standard method to edit the messages printed on that page, so you’ll need to use this hack:
const replaceUploadingErrorMessage = ()=>{ const uploadingErrorMessage = $(".PennController-PennController p:nth-child(2)"); if (uploadingErrorMessage.length > 0 && uploadingErrorMessage[0].innerHTML.match(/^There was an error uploading the recordings:/)) uploadingErrorMessage.html("Une erreur s'est produite lors du transfert :") .siblings(".Message-continue-link").html("Cliquez ici pour télécharger l'archive de vos enregistrements et les envoyer manuellement."); else window.requestAnimationFrame( replaceUploadingErrorMessage ); }; replaceUploadingErrorMessage();
Let me know if you have questions
Jeremy
October 29, 2020 at 11:25 pm #6273masatoParticipantHi Jeremy,
Thank you so much for your help! This does what I wanted to do!
Just one small thing: I guess$gt;
here is actually>
, right?Masato
October 30, 2020 at 8:55 am #6275JeremyKeymasterHi Masato,
You’re right, of course. I edited my message, it should now display
>
instead of$gt;
Jeremy
October 30, 2020 at 11:07 am #6278masatoParticipantCool! Thank you again for your help!
Masato
-
AuthorPosts
- You must be logged in to reply to this topic.