Possible small bug in Quiz Category naming with apostrophe?

Possible small bug in Quiz Category naming with apostrophe?

ໂດຍ Paul Robinson -
ຈຳນວນການຕອບກັບ: 7

Hi

I had a quiz category name with an apostrophe in it. When I tried to add a random question to a quiz from this category I got the "Could not add new question!" message. After trying everything else, I tried removing the apostrophe from the category name and then the question could be added! Anyone else seen this? I'm new to this too - how would this be logged as a bug?

regards

Paul

ການຈັດອັນດັບສະເລ່ຍ: -
ໃນການຕອບກັບຫາ Paul Robinson

Re: Possible small bug in Quiz Category naming with apostrophe?

ໂດຍ Howard Miller -
ຮູບພາບຂອງ Core developers ຮູບພາບຂອງ Documentation writers ຮູບພາບຂອງ Particularly helpful Moodlers ຮູບພາບຂອງ Peer reviewers ຮູບພາບຂອງ Plugin developers
Which version of Moodle? I had a quick look and couldn't reproduce it in 1.7.
ການຈັດອັນດັບສະເລ່ຍ: -
ໃນການຕອບກັບຫາ Howard Miller

Re: Possible small bug in Quiz Category naming with apostrophe?

ໂດຍ Paul Robinson -

Hi

Version 1.7 too. I tried closing the browser and logging in again, resaving the questions, checked the settings for each question was compatible with other questions in the quiz, changing the question names. Nothing worked till I removed the apostrophe in the category name.

This only occurred when adding a random question using the Add button. It did not happen when adding a specific question to a quiz.

regards

Paul

ການຈັດອັນດັບສະເລ່ຍ: -
ໃນການຕອບກັບຫາ Paul Robinson

Re: Possible small bug in Quiz Category naming with apostrophe?

ໂດຍ Joseph Rézeau -
ຮູບພາບຂອງ Core developers ຮູບພາບຂອງ Particularly helpful Moodlers ຮູບພາບຂອງ Plugin developers ຮູບພາບຂອງ Testers ຮູບພາບຂອງ Translators

Hi Paul,

I confirm the bug in Moodle 1.7.1+

Solution: In file moodle/mod/quiz/edit.php, towards line 185, replace:

$form->name = get_string('random', 'quiz') .' ('. $category->name .')';

with

$form->name = get_string('random', 'quiz') .' ('. addslashes($category->name) .')';

Tested, it works. If the bug is confirmed (and my solution works) maybe Howard could you add a bug report for it? thanks

Joseph

ການຈັດອັນດັບສະເລ່ຍ: -
ໃນການຕອບກັບຫາ Joseph Rézeau

Re: Possible small bug in Quiz Category naming with apostrophe?

ໂດຍ Tim Hunt -
ຮູບພາບຂອງ Core developers ຮູບພາບຂອງ Documentation writers ຮູບພາບຂອງ Particularly helpful Moodlers ຮູບພາບຂອງ Peer reviewers ຮູບພາບຂອງ Plugin developers
Thanks Joseph. Fix checked in to 1.7.1+ and later.
ການຈັດອັນດັບສະເລ່ຍ: -
ໃນການຕອບກັບຫາ Tim Hunt

תשובה ל: Re: Possible small bug in Quiz Category naming with apostrophe?

ໂດຍ Miki Alliel -
ຮູບພາບຂອງ Translators

hello everyone

I just got this error when trying to add random questions from a category of a course which the name of the category includes an apostrophe , and  without it it worked.

I tried that on Moodle 1.9.1 and moodle 1.9

is it going to be fixed in build weekly Moodle 1.9.1 ?

ການຈັດອັນດັບສະເລ່ຍ: -
ໃນການຕອບກັບຫາ Miki Alliel

Re: תשובה ל: Re: Possible small bug in Quiz Category naming with apostrophe?

ໂດຍ Tim Hunt -
ຮູບພາບຂອງ Core developers ຮູບພາບຂອງ Documentation writers ຮູບພາບຂອງ Particularly helpful Moodlers ຮູບພາບຂອງ Peer reviewers ຮູບພາບຂອງ Plugin developers
Oh, I see, this never got filed in the tracker. I have just created the report: MDL-14928 and am about to implement the fix (Joseph is right).
ການຈັດອັນດັບສະເລ່ຍ: -