Question Bank Problem

Question Bank Problem

Elmar Gatz -
回帖数:14

Hello,

 

First of all I am running moodle at version 2.5.1.

I love this feature called question bank, but I when I wanted to implement it into my moodle page, I recognized, that I am not able, to have one question in two different categories.

I understood, that a question is unique and has to be in one category. But I hoped first, that I could make a shortcut. For me, it is important to have that question at one point, where I am able to change it, so that it automatically changes all quiz.

I need to have one question in two categories, because I am going to make trainings for a lot of work instructions. There will be a quiz for every work instruction. Till here, I am able to work with the levels of the question banks. There will be also a quiz over all instructions. Once again possible to do with the levels.

But these instructions belong to different categories. And those will be taught later in a different course. Although I am able to use the same questions as quiz for this course.

But to search the different questions out of this huge pool of questions is quite much to do, if not even impossible.

My question is, if there is a possibility to filter in a question bank, when searching questions for a quiz? Or if I am able to give tags and to search them?

I hope you are able to help me.

Thanks in advice.

Best Regards

Elmar

回复Elmar Gatz

Re: Question Bank Problem

Marcia Young -

Click on the settings as if you were going to edit the question.  When you get into the question, change the category to the second category you want the question in.  Then at the very bottom, instead of clicking save changes, click "create new question"  You'll then have the question in both categories.

回复Elmar Gatz

Re: Question Bank Problem

Emma Richardson -
Documentation writers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像

I am not quite understanding why you need the question in two categories.  If you set up your categories at the system level, then you will be able to access them from all courses.  You can create as many categories and subcategories as you want making it easy to find the questions.  

You will need to set up a Question Editor role for teachers at the system level if you want teachers to have access to them too.  

回复Elmar Gatz

Re: Question Bank Problem

Rick Jerz -
Particularly helpful Moodlers的头像 Testers的头像

I am not the expert at this, but I will try to give you an idea of how to achieve what you are trying to do.

The question bank, in general, has categories.  The common ones are: System, Course Categories, and Course (individual).  Questions put into the system category can be used by any course.  Questions put into a "course category" can be used by any course in that category.  Questions put into the (individual) course category can only be used in that course.

I think that if you want to share questions between two courses, you then need to have these questions either in the System Category, or in the Course Category.

For example, I have a course category called "Business".  I like to put all of my Business courses into this category just in case I want to share questions between various business courses.

Actually, I am one who believes that one of the first steps in setting up your Moodle is to immediately define course categories.  Then, as one starts adding courses, they can be put into the appropriate already defined course category.  Many people don't think about having appropriate course categories set up so that the question sharing logic becomes easier.  Trying to fix this later on seems much more difficult to me.

Hope this helps.

回复Elmar Gatz

Re: Question Bank Problem

Elmar Gatz -

Thank you for all your help.

I think, I was not able to describe my problem.

I know, that I am able to share a question on system or category level. That is not my issue. I have to share a question between two question banks for another reason.

We got two logical categories. Something like the brand and the type. The brand could be BMW and the type car. For another thing could the brand be apple and the type Smartphone. You know what I mean?
In this moodle page first we make trainings for all different brands. After that, we got another course with trainings for the type.

As you can imagine, we got a lot of brands, and only 10 - 20 types.
The questions we created for the brands are also valid for the quiz for the type-course. And I got the problem, that we got a whole lot of questions and that it is not that easy to search the questions for smartphone out of all the different types.

I needed to search an alternative for my real matter and hope to have found a good one.

Thank you for your help..

回复Elmar Gatz

Re: Question Bank Problem

Rick Jerz -
Particularly helpful Moodlers的头像 Testers的头像

Quite honestly, your description does not help me understand your problem.

Remember that in Moodle, it is easy to "edit" a question, and then "make" (save) it as a copy.  Then, it is easy to move it into another category.  This procedure might help you.  The only thing that I personally don't like about copies of questions is that if I ever find a need to fix a question, the fix does not propagate to the copies.

Also remember that different "quizzes" can be made from the same test bank, picking different questions.

回复Elmar Gatz

Re: Question Bank Problem

Elmar Gatz -

Yes, tagging seems to solve all my problems, but as you said, there is no way to search for these tags when I want to create a quiz and  select questions from a question bank.


I hope there will be a solution for this soon ...

 

Thank you for your help.

回复Elmar Gatz

Re: Question Bank Problem

Ray Morris -

> Yes, tagging seems to solve all my problems, but as you said, there is no way to search for these tags when I want to

> create a quiz and  select questions from a question bank.

 That feature does exist, and we use it.  We also use one which shows the tags in the question bank list.  Unfortunately, neither are in the standard 

Moodle distribution yet. If you have a programmer or very tech-saavy non-programmer on your team, you can help get that integrated into standard Moodle 

by helping with the last step - writing tests which automatically test the new feature.  Your programmer or "near programmer" can also merge the feature 

into your copy of Moodle by pulling it from our git repository.

 

If you don't have a programmer or near-programmer on your team, and don't have any budget to help with the final step, you can vote for these new features

to get integrated.  The vote button is on the left side of these pages:

https://tracker.moodle.org/browse/MDL-40313

https://tracker.moodle.org/browse/MDL-40457

 

 

回复Ray Morris

Re: Question Bank Problem

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

Those issues are not being held up by a lack of votes. What is needed are patches that are good enough to be integrated. Both are very close to being good enough, but need a bit more work. The ball is in your court.

回复Tim Hunt

Re: Question Bank Problem

Ray Morris -

> The ball is in your court.

You may not have seen my other thread on that.  I'm passing the ball. It's not likely that I'll be able to write unit tests for Question Bank any time soon.

If there already WERE unit tests and I just needed to add tests for the new feature, I could probably do that.  Since there aren't existing unit tests, I'd need to do everything from scratch, just like other places where I've had to redesign an entire API in order to get a typo fixed.  I'm not going to be able to do that because I'm busy fixing bugs and writing useful new features.

 I have a ton of useful improvements our instructional designers and instructors use if you ever want to integrate them into your code. I've pretty well given up on integration.  A commit is rejected because it doesn't fix the whitespace formatting in other, unrelated code, then when that's added it's rejected because it DOES fix the formatting in the unrelated code.  A function is rejected because it has an object as a parameter ("pass class names, not objects", someone says).  Change it to accept a class name and it's rejected for doing so.  I could deal with that for NEW CODE I'm submitting, but I'm afraid I just don't have time do an entire module like that every time a change is made.  Maybe one day Question Bank will have unit tests and I'll merge some of the cool stuff we're doing, writing unit tests for our stuff.

 

 

 

 

回复Ray Morris

Re: Question Bank Problem

Ray Morris -

My reply above was a little whiny. The point is, I don't think I'll have the time.

In order to have unit tests on question_bank, the I suspect that the API will need to be changed - private methods made public, new methods added, etc.  I anticipate that would be very time consuming for anyone other than the maintainer to do since the maintainer would need to be satisfied will all of the changes.  I just don't have the time to commit to such a project.

 

回复Ray Morris

Re: Question Bank Problem

Marcus Green -
Core developers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像

I think I might have misunderstood your original post, were you saying that the question bank itself needs unit tests or your modifications for the search needs unit tests?

I downloaded your branch for a little plan and I liked what you have done but it struck me that creating unit tests for another persons code might not be trivial.

回复Marcus Green

Re: Question Bank Problem

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

Well, Ray is claiming that it would be impossible to write any tests for his new little bit without restructuring everything. I am not sure I really believe that, but still. In general, I think it is good that the integration team are starting to insist on tests with everything, but I think this one shoudl be allowed in as-is.

回复Marcus Green

Re: Question Bank Problem

Ray Morris -

 > were you saying that the question bank itself needs unit tests or your modifications for the search needs unit tests?

Both, mainly for question bank generally. The integrator has asked that my modification have unit tests. There are no existing unit tests for the question bank view, so my understanding is that in order test that question bank still works correctly with my modification, we'd need at least some unit tests for qb generally.  In other words, to prove in an automated way that I didn't break question bank, we'd need unit tests for question bank.

My experience with unit testing is limited, but from what I've seen, I don't know how to write unit tests for question bank without making significant changes.  I very much hope that Tim is correct, that he knows a way to do so. If I wrote them, I'd need to rework a lot of his code, getting him to sign off on all of the changes.  That's been a time consuming process in the past.

 

> it struck me that creating unit tests for another persons code might not be trivial.

Absolutely.  It would be hard for me to write unit tests for the significant amount of existing code, especially given my limited experience with unit testing.  It may be hard for Tim to write unit tests for my modification, though he was very involved in the process of getting my code to working in a way that he was ready to sign off on, so in some ways the modification is our code.  I imagine I could write unit tests for just my part, if unit tests for question bank generally were in existence.

 

If we used Behat rather than PHPUnit much fewer modifications may be needed, but I don't know if that's the best approach.

I'll defer to Tim on that because I suspect he's more clueful than I on the subject, and also because he's the maintainer.