Took yesterday off to get caught up on yard-work, and the dog really thanks me for the 💩 cleanup.
Had a thought last night and checked this morning. I have discovered that I really seem to have a context/permission/license problem.
For the past few days, I have only worked on these three files:
- exercises.php - generates a page that shows all the text-to-type and dictation files of each exercise in a lesson, along with links to edit each exercise and dictation file. It's the page shown in my two posts with only 1 exercise each time, but the page can have multiple exercises.
- simplehtml.php - the file that generates the page to edit the text-to-type and it's dictation file, of any selected exercise.
- simplehtml_form.php - the form used by simplehtml.php.
When I create some text-to-type and a dictation audio recording using simplehtml.php, I can immediately play it. Once I save and return to exercises.php I cannot play the file, but the text and player are there. If I go back to simplehtml.php to re-edit the exercise, the text is there and the audio plays as expected.
Now here is the thought I had. I went to another MooYper and another MooTyper in another course, and my file that I can play in the original MooTyper while editing, will NOT play in another MooTyper or another MooTyper in another course.
The little bit I have working is using a context of: $context = context_module::instance($cm->id);
Since MooTyper makes lessons available to the whole Moodle site, am I going to need to
Since MooTyper makes lessons available to the whole Moodle site, am I going to need to
- change the context to something else, e.g. CONTEXT_SYSTEM, CONTEXT_COURSECAT or CONTEXT_COURSE?
- figure out some way to give permission for the file to be played by anyone, anywhere in the site?
- or do something with the license entry for the file so that it can be played by anyone, anywhere in the site?
I think I will have to use CONTEXT_SYSTEM, since I cannot play my own file with CONTEXT_MODULE in the same course in another MooTyper and I am getting, HTTP load failed with status 407, when I try.
Sorry for the long, detailed post.