The index.php
file lists all of the instances of our activity that are present in the course. These are typically displayed in a tabular format with one row per activity instance, and with a column each for name, intro, and possibly some response data. For activity Foo!, we are displaying the value stored in the response for the individual user to the question "Did you learn?". Again, we will just focus on the changes being made to the template to make this happen.
There are a few places in the NEWMODULE template where strings are hardcoded in the output. We need to change these to use get_string
. Around line 44 of the /mod/foo/index.php
file, we need to make a one-line correction. This is very important to allow your module to support localization for other languages:
notice(get_string('thereareno', 'moodle', $strfoos), "../../course/view.php?id=$course->id");
We have covered Moodle's language file system in depth in Chapters 1, 2, and...