Posts made by Ray Morris

The infrastructure to search the question bank based on tags is now integrated in master and should be included in Moodle 2.7 when it's released.  Though the underlying infrastructure is included, the GUI to actually find questions by tag within the question bank currently requires a 3rd party plugin from TEEX. We plan to submit this to https://moodle.org/plugins/ upon the release of 2.7.  The current plugin allows one to find questions which are marked with any number of tags and also narrow it down to those questions which are NOT marked with some other tags.

 

For example, one could find questions tagged "Math" but NOT tagged "Calculus" to find non-calculus math questions.

An early version of the plugin is available on the tracker.

 

 

"a feedback quiz".  It sounds like you want a Feedback or Survey activity, not  a Quiz.

Quiz, Feedback, and Survey are different types of activity. A Feedback is used when you are interested in reading the answers.

A Quiz is designed to to assess a student's knowledge.  As such, reports from Quiz center around the student, answering the question "does the student know the material?"   Reports from Feedback and Survey center around the responses, answering "what do people have to say about this question?"

 

 

 > 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.

 

 

 

 

 

 

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.

 

>  fall short on question tagging and metadata, in other words... if there are customizable extra fields for each question

> that I can add to better store and retrieve the question, combined with a search function

 

Those improvements, including a really powerful search function, have been written but are waiting for someone to write a suite of unit tests for the Question Bank system.  

Those unit tests may need to be extremely well written in order to be accepted for integration.