It is possible to have a database with a field that is only visible to the teacher

It is possible to have a database with a field that is only visible to the teacher

Peter Evans -
回帖数:3

The situation is that we want to use a Moodle database to maintain a support FAQ. Most of the fields contain information that is visible to the user (students and staff who look up the FAQ) but we also want a field containing instructions for our helpdesk staff which will contain our internal process for handling the job.

Does anyone know of a way to hide a single field when the database is viewed by a student but to show it when it is viewed by a teacher?

Currently we are using a Glossary to house the support FAQ and we put the public entry into the glossary entry body and put the private instructions in a comment and then hide the comments from students.

Thanks in advance for any assistance,

Peter Evans

回复Peter Evans

Re: It is possible to have a database with a field that is only visible to the teacher

Itamar Tzadok -

No standard way. As a workaround you can show the designated fields by css subclass of 'editing'. The idea is that teachers can turn block editing on, in which case, the body of the page is assigned the css class 'editing'. So if you set the designated fields to show only under the 'editing' class, teachers will be able to reveal them by turning block editing on. Of course these fields are still accessible to students in the page source, but if the information is not confidential, this is not a problem.

I'm working on a plugin which will allow you to design more than one view (among other things) such that you could have one view for students without the instruction fields and another for teachers with these fields.

微笑

 

回复Itamar Tzadok

Re: It is possible to have a database with a field that is only visible to the teacher

Peter Evans -

Itamar,

As always thanks for that workaround. Another possibility that would prevent the student from seeing the content is to include the field in the editing template but remove it from all others

Yes, it would be ideal to have have a REAL way of showing or hiding a field based on roles. If you want me to comment or test your plugin feel free to ask.

Peter Evans

回复Peter Evans

Re: It is possible to have a database with a field that is only visible to the teacher

Itamar Tzadok -

The 'role-based fields accessibility' is definitely on the agenda. But my plugin already does quite a few new things so we should see how it performs before adding more.

The plugin must be released soon for testing and any help in the testing would be greatly appeciated. Stay tuned to MDL-26983.

微笑