For the question bank use case, not all users who can see the question item prompts should be able to see the answers or solutions. Leaving alone the behavior of quiz.module, the question and itemcollection nodes can implement a new permission, "view quiz question solutions".

If a user has access to "view quiz questions outside of quiz", they can see the prompt in a question node or itemcollection node_view(). But they won't see the multichoice answers, for example. If they have "view quiz question solutions" then they will see the multiple choices, along with the correct choice. They will also see the acceptable short answers and the long answer grading rubric. If a worked example solution is available, that will also be displayed.

CommentFileSizeAuthor
#1 quiz-512674.patch8.72 KBdbesse

Comments

dbesse’s picture

StatusFileSize
new8.72 KB

This adds 'view solutions' permission which allows users with the view questions outside of quiz permission to also see the solution. If they do not have the view solutions permission (but still have view questions outside of quiz), they can see the prompt but can't see the multiple choice or matching options.

turadg’s picture

Status: Active » Needs work

Patch reviewed and committed. I changed "view solutions" to "view quiz question solutions" to match "view quiz questions outside of quiz" permission and avoid a potential name conflict with modules other than quiz (that might want to have a permission called "view solutions").

Before I close this, let's make the answers view look a little better. For example, the radio buttons shouldn't be clickable since it can't be answered outside a quiz. We can disable them and mark the right answer as selected, instead of with the words.

turadg’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.