ngandrass / moodle-quiz_archiver

Archives quiz attempts as PDF and HTML files for long-term storage independent of Moodle
GNU General Public License v3.0
5 stars 3 forks source link

[Bug]: in the archive setup form, the forbiddenchars and variables do not display correctly in Moodle 4.2 #24

Closed ndunand closed 2 months ago

ndunand commented 3 months ago

Quiz archiver moodle plugin version

latest

Quiz archiver worker version

latest

Worker service deployment method

Docker compose

Moodle Version

4.2.8

PHP Version

PHP 8.1

Database

MariaDB

Operating system

Debian 12

What happened?

Expected behavior:

Screenshot 2024-07-04 at 14 38 08

works fine in Moodle 4.4

Actual behavior:

Screenshot 2024-07-04 at 14 37 43

localized strings are not resolved in Moodle 4.2

Additional information:

Steps to reproduce

  1. Navigate to the archiver page
  2. Display the Advanced settings section
  3. Click on the Archive name setting tooltip or on the Report name setting tooltip

Relevant Moodle / PHP log output (if applicable)

No response

Relevant quiz archive worker service log output (if applicable)

No response

ngandrass commented 2 months ago

I was able to reproduce the problem and will look into it now.

ngandrass commented 2 months ago

Found the problem. Support for variable substitution in language strings of help buttons came with Moodle 4.3. See: https://github.com/moodle/moodle/commit/36b865b3d90f1a0561b01c88b0be59d662a8598d

Since the content for these help buttons comes exclusively from the language strings it will be hard to inject something there. The only quick solution I see would be to have a static language string for Moodle <= 4.2. That's dirty but should at least work.

ngandrass commented 2 months ago

Fixed with fd86130fbdaaa61b5607ac5dfd7e9944356beea6 Release will follow today