http://www.drosson.at/moodle-test/
To get teacher rights, please send me an E-Mail at: nicolas.drosson(ät)students.jku.at with username and password. It will be done until the next day.
cu Nico
The sharing would work with moodle 1.5, but it needs some small modifications because the questions in 1.6 are not in the quiz module anymore. Also before you go in production with this, you should test it (I may have forgotten some test cases). I will post a version that works with 1.5 in the next days.
Hope you'll have fun with it.
Nico
Could you please make a version of your module for making quiz questions shareable at teacher level as in this discussion?
Thanks
Joseph
I hope it is what you wished. Now it is possible to publish a category in all courses where you are a teacher. It means:
You publish it for you in course1 and you are also teacher in course3 so you can use your question category also in course3, but the other teachers of course3 cannot see the category. All the teachers of course1 that are teachers in other courses can also use the question category in their courses.
It was now a fast hack. I think it will need some improvements.
I checked whether the import and export should work and it seems to work for moodle153. The Backup of courses is still a to-do for this hack.
Regards. Nico
I download it and just give it a try. It really works! But there is one thing that I can't make sure. In your attached file, a sub-directory, "question", with three files, exists under the directory "categories". Do I need to upload this directory onto my Moodle site? If necessary, where should I put it? Now, without uploading this directory, this fuction of category sharing seems to work fine.
Thanks again for your great help!
Regards Alex
You should test it very well before you go in production with it. I did not have a lot of time to test it on 1.5.3. Please tell me if you find bugs. I will try to fix them as fast as possible. It is not a big change so if you want to find the changes, just look for "ndr". I marked all my changes with it.
Regards Nico
PS: Here is the version without all those unneeded files.
thx for the feedback. I will probably need some help from english natives. I speak other languages much better than english. There is only one thing I did not consider: the backup of tests. It is possible, that this doesn't work well. I can remember I looked at it some weeks ago, as I began, but I had some difficulties (It was in moodle 1.6 Alpha).
You also have to be carefull when you share a question category, because a shared question category which parent is not shared will not be visible in other courses. Another example, if a category c1-1 is shared for all and its parent c1 is only shared for the own course category, c1-1 will be automatically shared only in the course category of c1.
If you have any suggestions on how I could improve the patch, please let me know.
Regards Nico
One small comment, since I was taking your patches to \mod\quiz\editlib.phpfrom version 1.8.2.11 and using them to modify a later version of the quiz module (1.19). You did a good job of commenting the changes that you made to the code which made it easy to pull the code into a different version of the same file which I am using on my production server. The first time I tried it, I missed adding in the global $CFG; line in the quiz_print_category_form function. I am not sure if this was dropped from an earlier version or something you added. In newer versions of the file it is not there so you may want to add your // BO added ndr and //EO added ndr lines around that otherwise the sql statement will not execute. I would be happy to revise the help file text in English to help make it less ambiguous. Thanks for the warning on parent categories - I will keep that in mind and if I think of any improvements or suggestions I will certainly let you know. For now, I am very pleased with how this works.
The option "publish to self" (Joseph also needs it) is maybe not so difficult to develop, but I think it is not good to have only the 4 options. It would mean, if I share my category only with the course category, I can't share it with my other courses (if I'm a teacher). I think, it would be better having 2 fields of options: share with all courses of the current category or all courses at all or don't share / share with all my courses or don't share (another option to this could be: share with all my courses and those of the other teachers in the current course. It's just an idea), but I think, if I'm doing it this way, I should discuss with designers so they tell me the best way to make it easy to use and "self explaining".
I've worked around the bi-catagory problem by NAMING each question with a prefix of RQ!, RQ2 and FT (reviewquiz1, reviewquiz2 and final test). So now I can quickly see a listing of questions for each test displayed all in one place.
However, anonther question has popped up: How do I delete a question from one catagory without deleting it from the other catagory. Right now both listings are gone unless it is shown as an "old question" in both. AND...this deletion of the question from both lists is not what it says is going to happen when I delete a question from one catagory.
Thankx. Joe
De rien. Here is the latest version for moodle1.6. I would say it is still an alpha version. This one still doesn't implement the sharing at teacher level. I don't have talked about it with Gustav. At the moment, I don't have enough time, but I think I will.
A bientot Nico
I think it happens because the quiz module and questions have been modified a lot in the time after I published the category sharing. This week, I have no time to check what's wrong because I'm finishing my offline quiz module. I will probably look at it next week.
Regards Nico
After some hunting, I stumbled across the \question\showbank.php file. I simply added an OR publish='2' and it now works - in other words - I replaced line 154 with:
if (empty($SESSION->questioncat) or !count_records_select("question_categories", "id = '{$SESSION->questioncat}' AND (course = '{$course->id}' OR publish='1' OR publish='2')")) {
I figured that was OK since it had already selected the eligible categories that there was no need to check again that it was within the course category but this may be a theoretical since the code here is not explicitly checking for that possibility.
You may also want to look at the code for direct reference to publish being 1 in throughout. I did a grep for publish and have more details in the feature request (Bug #5437). When you get a chance to get back to the publish question category code I wanted you to have a place to start
You may well find other places and have a more elegant solution that will handle other possible publish values. It could be that a simple check for publish<>0 or publish>0 will work in some cases but the $sql= code (~line 180) that you created in \question\editlib may be needed in others. For the time being the change to showbank.php seems to patch it for me.
I am going to post this also in the feature request (Bug #5437) so that there is a documented list of places to check the code along with a recommendation that the $publish variable be changed to $qcatpublish (i.e. QuestionCategoryPublish) to make it easier to search for.
Peace - Anthony
For Moodle 1.53 I also created an option to share the categories only in the courses where the teachers are also teacher. It is easier to explain with an example:
Nico and Tim are teachers in the course toto.
Nico and Mark are teachers in course tata.
Tim and Tom are teacher in course titi.
In the course toto, Nico creates a category and shares it in all its courses. This sharing has the effect, that Tim also sees the category in all its courses. I don't really remember, but I think this has a problem: Mark and Tom wouldn't see this category if I remember well.
Should I look if I can adapt this sharing option to the patch?
Regards Nico
本讨论区帖子已移除
本讨论区帖子已移除
Sure I will publish it. I mean, I will publish the new module and the necessary patches. The written work is in german so I don't think it would be interesting for you. I may begin to translate it in french, but I don't think I will do it in english. I'm not sure if the difference is clear in english between diploma thesis and the word thesis alone. What I mean is with diploma thesis is the big work at the of my study to become Master of Economics, E-Business and E-Learning. It's not a thesis for a PhD. I don't know if this exists in english...
Before the publication I just need some more time because I still have 3 Bugs. 2 of them are common with the quiz module: The 2 Bugs I commented yesterday, one in comment.php the other in Backup/Restore. I want to correct them before I publish everything.
Regards
Nico