New Capapility for teachers

New Capapility for teachers

by Rabee Elbes -
Number of replies: 8

Hi,

I am using moodle 1.9.10

 

I want the teachers to see the quiz password  in the quiz view report

 

mod/quiz/view.php

 

how can i add this as a capapility and enable it or disable is from admin roles panel

 

Thank you

Average of ratings: -
In reply to Rabee Elbes

Re: New Capapility for teachers

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Well, do you know how to program in PHP? and, have you taken a look at the code in mod/quiz/view.php?

Also, do you really need a new capability for this, or could you re-use one of the existing capabilities (perhaps mod/quiz:viewreports)?

In reply to Rabee Elbes

Re: New Capapility for teachers

by Colin Fraser -
Picture of Documentation writers Picture of Testers

mmm Thinkvery carefully about this. AFAIK, the password referred to here is the User's password, and it is checking to see if they have been properly authenticated and eligible to access the quiz. It actually has nothing to do with the quiz. There are some very obvious security and privacy issues here and I am not sure that what you are suggesting is workable at this point. You may be able to hack the code to do it, but I am not sure it would be worth the effort.

In reply to Colin Fraser

Re: New Capapility for teachers

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

No, Colin, we are talking about the quiz password.

In reply to Tim Hunt

Re: New Capapility for teachers

by Rabee Elbes -

Thank you dears,

 

Yes I know little php,

I just want to add the view quiz capapility ,doesnt matter if it is new or a copy of an existing capapility,

I just want to know how to do it.

What steps should be followed?

Thank you

In reply to Rabee Elbes

Re: New Capapility for teachers

by Colin Fraser -
Picture of Documentation writers Picture of Testers

I must have misunderstood, but then I would never consider putting a password on a quiz. I put quizzes inside courses, and make sure that only people who are supposed to be there are there. I do not understand the need for additional passwords? if a test is not for everyone in a course, why put it there?

I understand, I think, what Rabee means though, from his second question.

If I have it right, then Rabee, you are asking if you can ensure that Teachers have the right to view a quiz, whether they have access  to the course or not? How can you set or reset that capability. Use permissions. Go to the Role you want to change and edit that Role's capabilities. For example, go to Users > Permissions > Define Roles and select the Role you want to change. Select  Edit, then "Find" what capability you want and then reset to "Allow".  Teachers can already see their own Quizzes in their own courses, but not other people's. I am not sure that they can see all quizzes without accessing all courses. Is that more in line with what you are asking?

In reply to Colin Fraser

Re: New Capapility for teachers

by Rabee Elbes -

Dear Colin,

I dont think you get my point,

I want to add this capapility to the roles inside teachers roles,

its not there by default,

If the teacher opened the quiz reports the quiz password shoud appear to him without having to update the quiz and see the password from insdide quiz .

see the screenshot please

 

Thank you

In reply to Rabee Elbes

Re: New Capapility for teachers

by Colin Fraser -
Picture of Documentation writers Picture of Testers

ahhh now I get it... I would suggest that is not a capability, that is a coding hack. I think that you may find a bit more help on the Developers Forum than here. Tim is far more likely to guide you in the right direction than me though.

 

In reply to Colin Fraser

Re: New Capapility for teachers

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Acutally, it is fine to talk about quiz-related coding hacks here.

Rabee, does that screen-grab mean that you have worked out how to do this?