Adding single questions directly to quiz - completed

Released version 0.21 to tracker. I am planning to put a demo moodle here, once most other features will have been completed. For now, you can look at the static HTML demo and if you wish, download the version in the tracker for testing.

There were a couple of issues with the current quiz/questions. The most pressing one is that the Edit/Add Questions page seems to absolutely require a question category as a parameter. It would fit the workflow much better if a category could be unspecified once entering the question editing page with a new question. Then, the user would have to think about categories at least as much as to select the default category from the list. The changes required to do this seemed too dramatic so they should probably be discussed with Tim Hunt/the community. For now, we are preselecting the default category for the user.

Some highlights: To get quiz work as designed, I added a new GET parameter to the question editing page, which allows specifying the name of a GET parameter to return a newly created question’s id to the page in returnurl. Also, the quiz editing page got a new get parameter, addonpage, for specifying the page on which to add a new question.

3 Responses to “Adding single questions directly to quiz - completed”

  1. Tim Hunt Says:

    Category is currently required when creating a new question, however, this is only really used to get a contextid, so we know in what context to check permissions. And it only sets a default category, there is still a dropdown menu at the top of the form to let the use choose a category. What is wrong with that? As a user, I would much rather a sensible default category was chosen for me and I did not have to think about it.

    If you wanted, you could change it to accept a contextid as an alternative to a categoryid, and then make the category dropdown a required field that starts blank (’Choose …’). It is not very hard, but as you say it does involve changing a number of files, which

    I don’t think you need a new parameter on the question editing page. That is unnecessarily flexible. Just hard-code the name of the parameter added to returnurl as newquestionid, or something like that. That is a bit simpler.

  2. Olli Says:

    I do think that it is the choice of the calling module what to call its own parameters, not the choice of the question module, that is why I chose to parametrize the parameter name. It seems entirely posscreatedquestionible that the further processing operation of the calling page would be a totally different operation than adding a question. Edit:Perhaps, if the parameter would be something generic/from the point of view of the question page - like createdquestion - it would make sense, but now it is addquestion, which unnecessarily ties it to the parametric ideas of the quiz editing page. However, this is up to you and I certainly can hard code it.

    The reason I think it might be good for especially a novice to have to consciously choose the category is that especially some people in the original suggestion saw question categories as an important structure, the usage of which should be enforced on /all/ users. I do not think it should be enforced, but now that the question bank is hidden in the quiz view by default, encouraging people to use categories at least while creating questions is not harmful - and a dropdown probably does not slow anybody down much anyway. This is not crucial, but may help novices to get started on their dreadful ;) journey to understanding the question bank.

    Perhaps a better approach would be to make the category list visually more prominent/attention catching, i.e. the entire list visible in a sidebar, for example.

  3. Olli Says:

    If the parameter would be createdquestion, that would essentially mean that edit.php would need to accept both addquestion and createdquestion for adding questions…

Leave a Reply