studentquiz / moodle-mod_studentquiz

Moodle-Plugin
GNU General Public License v3.0
38 stars 37 forks source link

StudentQuiz: Must not refer to GET or POST in code #667798 #454

Open BruceGoodGuy opened 1 year ago

BruceGoodGuy commented 1 year ago

Hi @timhunt ,

Regarding this ticket, I have made an effort to eliminate the usage of $_GET and $_POST in the studentquiz module and adopt an alternative approach.

To achieve this, I have added parameters to the URL and subsequently reloaded the page with the updated URL. Consequently, we can obtain these parameters using the built-in functions optional_parameter and required_parameter.

However, in certain cases, specifically in file view.php at line 63, the request includes dynamic parameters such as 'q_123', 'q_456', and so on. Unfortunately, these parameters cannot be retrieved through any other means. Therefore, I have resorted to using $_REQUEST to access them.

Could you kindly assist me in reviewing these changes? Thank you.