We have just completed our changes to the module's form. This form is called when the user adds our activity to a Moodle course. Let's test the form, and make sure that it works correctly.
1. Let's navigate to a Moodle course
Click Image to Zoom
2. Add our activity to one of the course's topics or weeks.
In our case, I am adding it to the second week, where I also have a corresponding forum discussion that will use to feed our module.
Click Image to Zoom
3. Fill out our form
WOW - Notice how much cleaner the form looks since we made some slight modifications. And look - our custom block and dropdown list are both rendered!
Click Image to Zoom
4. Save and Display the Form
Click Image to Zoom
Now we have a working module form. Making a few changes to the module template and adding less than 10 lines of code has left us with a registered, functioning Moodle module.
If we look at the database, we notice that we have populated table mdl_inyourface with a row that ties our new entry to the course:
WAIT!
We just introduced a new variable to our module - postlimit. This is new data that was not part of our original installation. When the user saves our activity to a course, our new data element gets lost.
It's time to look at how Moodle module updaetes work. We will also need to take a detour and look at the Moodle XMLDB Editor.
Next Article in Series
No comments:
Post a Comment