Teacher / Admin entries approved by default

Teacher / Admin entries approved by default

av Jon Witts -
Antall svar: 25
Bilde av Plugin developers Bilde av Testers

Is there any way to stop teacher / admin entries into a database being approved by default?

I am trying to set up an electronic form for our staff to use to file an absence request. I have successfully set up the templates and configured the database so that entries require approval but the approval link is not available (effectively keeping entries private).

However if a teacher of the course or a site admin posts an entry to the database they are approved by default. If overlooked this could allow personal information to read by others...

Is there any way to stop this behaviour?

Thanks,
Jon

Gjennomsnittlig vurdering: -
Som svar til Jon Witts

Re: Teacher / Admin entries approved by default

av Itamar Tzadok -

Stop using the Database and start using another module in its stead for this purpose? blunker

Afaict there is no way but hacking the code.

smiler

Som svar til Itamar Tzadok

Re: Teacher / Admin entries approved by default

av Jon Witts -
Bilde av Plugin developers Bilde av Testers

And which module would you suggest Itamar? blunker

I kind of thought that hacking the code would be my only option...

I was going to look at the dataform module to do this, but still get a little bit twitchy about adding too many non-core modules to Moodle... In the past I have had issues updating Moodle installs due to non-core modules. Either because they do not get updated to support the newest version of Moodle or (very rarely) they cause issues in the database at the point of upgrade...

If I am honest developing this database has felt like hammering a square peg into a round hole...

Jon

Som svar til Jon Witts

Re: Teacher / Admin entries approved by default

av Itamar Tzadok -

Well, the Dataform is well supported and there is no intention to drop support in the near future. You can see the changelog in the Set: Dataform tracker.

To put things in perspective, the Dataform is maintained and further developed on the most recent Moodle dev version. On production we are currently using Moodle 2.6 and a backported version of the Dataform. Dataform activities are created on Moodle 2.9 dev and imported by way of the Dataform preset into Moodle 2.6 courses. And it works. We will be using Moodle 2.8 and the respective Dataform 2.8 in the next academic year.

The Dataform allows for separate participants mode by activity setting or by permission. It allows for multiple entry states and defining transitions between states by role. And so on.

That said, if you want to try hacking the Database code then the culprit code is in mod/data/lib.php around line 840:

    if (has_capability('mod/data:approve', $context)) {
        $record->approved = 1;
    } else {
        $record->approved = 0;
    }


hth smiler

Gjennomsnittlig vurdering:Useful (2)
Som svar til Itamar Tzadok

Re: Teacher / Admin entries approved by default

av Jon Witts -
Bilde av Plugin developers Bilde av Testers

Hi Itamar,

Thanks for the response and for pointing me in the direction of the code... However I am trying to keep our Moodle install as close to core as possible, and hacks to the core code sit less comfortably with me than lots of non-core plug-ins (Mainly because I know I am likely to forget to reimplement the hack after an upgrade!

I think my best course of action in this is to put my concerns re: non-core plug-ins aside and test out the dataform option.  I am glad to hear that it is supported into Moodle Dev too. I think I will trial it out on my 2.8 test install and if all goes well upgrade our live Moodle to 2.8 over the Easter break.

Many thanks,

Jon

Som svar til Jon Witts

Re: Teacher / Admin entries approved by default

av William Lu -
Bilde av Particularly helpful Moodlers

Hi Jon,

As long as your staff has a teacher role, they can view everything about your database, include templates setting etc, unless you spend time to overwrite a role permission in this activity only, you have to click on 'prevent' or 'prohibit'   many times.

If you want to record a staff request with privacy, the quickest way is to create a new course AND:

1. Enrol your staff member as students

2. In course setting > Role renaming > Your word for 'Student' = Fantastic staff member

Then, what you did (Require Approval, but remove approve tag) will work and that is a perfect setting, well done.


How about site admin? Nothing can be hidden from site admin, I hope your site has one or two admin role only.

IF you do have many admin roles but they are only nosey bosses, you'd better duplicate a student role and give a name something like 'Superboss' to make them happy.

Anyway, Moodle is very flexible and easy to customise and the standard database module can do many things and will be able to do more in Moodle2.9. 

Of course, you can follow Itamar's magic hack too, if you don't want to create a new course. Thanks to Itamar.

Gjennomsnittlig vurdering:Useful (1)
Som svar til William Lu

Re: Teacher / Admin entries approved by default

av Jon Witts -
Bilde av Plugin developers Bilde av Testers

Hi William,

That is exactly how I have set it up; however the issue arises when the course administrator (renamed teacher role) comes to add an absence request for herself... As all entries to the database module by a user with the teacher role or higher are automatically approved, her absence request becomes visible to all members of staff (renamed student role). 

I have included the "remove approval" control in the "View single" template so that the course administrator can hide her entry; but for the nature of what some of these entries could be, and the fact that people often forget things; I am not too comfortable with this...

I can see this method of using the database working for a personal journal between teacher and student (when the teacher is unlikely to add an entry to the database); but in situations where the privacy of the entries is vital AND when the course teacher will also need to add entries; I just don't think the Database module is up to the task.

I appreciate that I could implement Itamar's hack; but then we come back to people forgetting things when I come to upgrade our Moodle install blunker

Thanks,

Jon

Som svar til Jon Witts

Re: Teacher / Admin entries approved by default

av William Lu -
Bilde av Particularly helpful Moodlers

Hi Jon,

You replied so quick. I was editing my last post, just adding lines about overwrite role permission in that activity only.

I don't think it is too much work to create a new course to lower a teacher's role. But, if you don't want to do so and you want to keep everything inside one course, you have to:

1. Enroll teachers as student, rename as Staff

2. Assign teacher role in each OTHER activity only when needed. Leave the database mod's role untouched.


'I just don't think the Database module is up to the task.'

I am sure you believe in Moodle standard features. Moodle has many ways to customise a role permission, just need some tests to find a good and quick work around.

Som svar til William Lu

Re: Teacher / Admin entries approved by default

av Jon Witts -
Bilde av Plugin developers Bilde av Testers

Hi William,

The database in question is in a course of its own and the members of staff will be enrolled to that course as students. 

Looking at the code which Itamar posted it seems that the permission I would need to override for the course teacher role is the "mod/data:approve" permission. I will give this a go with my test course and see how it goes...

I am also going to test the dataform module too as I am interested to see how its notifications stand up against the event monitoring I having to use to get notifications from the datbase module.

I will of course let you know my thoughts / findings.

Thanks,
Jon

Som svar til Jon Witts

Re: Teacher / Admin entries approved by default

av Jon Witts -
Bilde av Plugin developers Bilde av Testers

So very quick results of my testing in terms of overriding permissions...

I set the "mod/data:approve" permission for the course teacher role to prevent and then logged in as my teacher user to check if their database entries were unapproved.
The good news is that their database entries are indeed unapproved by default; the bad news is that the ability to see unapproved entries is also tied into that permission!

The result of this is that our teacher user can no longer see the posts of everyone else... So with what we are trying to achieve here the only way I can see of getting the behaviour we want in this instance would be to hack the code as Itamar described. The downside to that of course, is that it changes the behaviour of all database instances across our whole site... Not what we want really!

I really think that this is a case of square peg into a round hole; and I am now going too explore Itamar's Dataform activity to see if it can provide the functionality we need.

Jon

Som svar til Jon Witts

Re: Teacher / Admin entries approved by default

av Itamar Tzadok -

A quick expalanation how to individualize a Dataform activity and note to myself to update the docs.

One setting and two permissions can affect whether the user can is limited to viewing only his/her entries.

Separate participants by activity setting


The activity setting 'Separate participants' set to 'Yes' will restrict all roles which do not have the 'mod/dataform:manageentries' capability to their own entries. By default permissions, that's all roles below editing teacher. This means that non-editing teachers are also restricted to their own entries by this setting. If you want to allow non-editing teachers (graders/TAs) access to certain entries you can use an Entry access rule and set the rule with entry filter to fetch the designated entries and a role override where you assign the designated non-editing teacher to the editing teacher role.

Separate participants by denying the mod/dataform:entryanyview permission


By default the mod/dataform:entryanyview permission is granted to everyone. You can exclude certain roles in the activity level by removing the role from the permission (Prevent), or by adding the role under Prohibited. Note that if you want to then grant the permission to particular users from the excluded role, use the Prevent method and then add an Entry access rule with a proper override.

hth smiler

Gjennomsnittlig vurdering:Useful (1)
Som svar til Jon Witts

Re: Teacher / Admin entries approved by default

av William Lu -
Bilde av Particularly helpful Moodlers
The good news is that their database entries are indeed unapproved by default; 

Have tried to enrol your teacher as student? If so, you don't have to change the permission. Quick and easy and works.

the bad news is that the ability to see unapproved entries is also tied into that permission!

I might miss understood your goal, do you want your teachers to add entry of private info but can be seen nor, see other's entry?

Som svar til William Lu

Re: Teacher / Admin entries approved by default

av Jon Witts -
Bilde av Plugin developers Bilde av Testers

William,

The goal is this:

A database/form entry system that allows members of staff (assigned the default student role in this course) to submit on-line requests for absence. These requests will then be processed by another member of staff (who are assigned the teacher role in this course) and permission will be granted or denied for the request.

The end result of this is to remove our current paper based system for this process.

So the issue arises because the member of staff who will be overseeing this area, will herself also need to submit requests for her absence at times through the same system. 

This is where the default approval status for teacher database entries causes us the issue.

It would be too likely that the teacher of the course (or any site admins for that matter) would add a request for absence and forget to remove the approval of it. This  would then make their private absence request to become visible to all members of staff in the school (students in the context of this course!).

I have tried all suggestions and I can see no way that the database module can securely separate entries for all users (students and teachers) without having to rely upon teachers and admins to remember to click an extra link.

Whilst this may well be acceptable in the standard class context of the use of the database module; it will certainly not be acceptable when trying to collect sensitive HR records from members of staff.

I appreciate your thought and time on this matter however.

Many thanks,
Jon

Som svar til William Lu

Re: Teacher / Admin entries approved by default

av Jon Witts -
Bilde av Plugin developers Bilde av Testers

Perhaps more succinctly...

Teachers of this course must be able to see ALL database entries. But students must only be able to see their own entries. Teachers entries must also not be automatically approved; as this exposes the teacher's entry to all students...

Jon

Som svar til Jon Witts

Re: Teacher / Admin entries approved by default

av William Lu -
Bilde av Particularly helpful Moodlers

Hi Jon,

Thank you for your clear explanation. I got it (sorry, I am slow) and will think about it. I need some time..... Were you online 24 hours without sleep?

Som svar til Jon Witts

Re: Teacher / Admin entries approved by default

av William Lu -
Bilde av Particularly helpful Moodlers
Teachers of this course must be able to see ALL database entries. But students must only be able to see their own entries. Teachers entries must also not be automatically approved; as this exposes the teacher's entry to all students...

Goal: 

Teachers of this course can to see ALL XXXX entries. But students must only see their own entries. Teachers entries must also not be see by students. ------->>>>>>>>It is Feedback!

Set settings as below:

feedback

Too get a sum of one user's total absence over a period time, do this:

xls

You boss will be happy about the spreadsheet, you can sort it out easily.

Som svar til William Lu

Re: Teacher / Admin entries approved by default

av Itamar Tzadok -

William, I think you are missing the point of the requirement. This is a request form and the request needs to be processed and approved or declined. The requester needs to be notified of the decision. I suspect that the Feedback module is not designed for that. Nor any other core module. smiler

Som svar til William Lu

Re: Teacher / Admin entries approved by default

av Jon Witts -
Bilde av Plugin developers Bilde av Testers

Hi William; thank you for giving this so much of your attention but I am afraid that Itamar is correct. This is a replacement for a paper form with multiple text fields and options to fill in / choose from. This is why I started looking at the database module -  as AFAIK it is the only core module which lets you build custom forms to collect user input. 








Som svar til Jon Witts

Re: Teacher / Admin entries approved by default

av William Lu -
Bilde av Particularly helpful Moodlers

Hi Jon,

I wish you can try the feedback mod sometime. It is the right tool to collect user info and can export to a spreadsheet. Also can send email notification. 

Of course, you can have all kind of form fields, you might know that it even has 'depended fields', so you can design a branched questions like: Are you sick > goes to sick question; Were you late > goes to late questions.


HTH

Gjennomsnittlig vurdering:Useful (1)
Som svar til William Lu

Re: Teacher / Admin entries approved by default

av Jon Witts -
Bilde av Plugin developers Bilde av Testers

Hi William, I will give it a go on Monday. Thanks again for your help with this. Jon.


Som svar til William Lu

Re: Teacher / Admin entries approved by default

av Itamar Tzadok -

William, I think that we are well beyond the point of considering only core features as standard. As infrastructure becomes more and more complex, Moodle, and all other major LMS platforms for that matter, have to funnel most of their resources to the development and maintenance of that part of the core (e.g. plugin support, reports, analytics etc.). End user features are now the domain of third-party providers. Consider that more and more plugins are now developed by Moodle partners and other professional companies. These plugins are typically well tested and uptodate and are likely to be better supported than any end user feature in core Moodle that is maintained by HQ. Even the main core Moodle modules, e.g. Quiz, are developed and maintained by third party providers. LMS providers will now encourage you to use LTI to connect from the LMS to external activities which can be delivered on any platform. This is becoming the standard.

So, in my opinion, to really take advantage of what Moodle can offer you, you need to overcome your (or your institution's) concerns and start using plugins from the plugins repo. There are pretty good plugins there that can change your learners experience dramatically.

smiler

Gjennomsnittlig vurdering:Useful (1)
Som svar til Itamar Tzadok

Re: Teacher / Admin entries approved by default

av William Lu -
Bilde av Particularly helpful Moodlers
 you need to overcome your (or your institution's) concerns and start using plugins from the plugins repo.

Hi Itamar, 

I really appreciate your advice, just as how I respect your advanced skills.

You might not know that I am super fan of many Moodle plugins and I do believe plugins make Moodle outstand from all of other LMS/CMS.

I test most of plugins, that is part of my everyday role, and write report to my bosses. the main concern from clients and from my experiences is that: Is it reliable? And how to know that? One rule only: Does it give you an error message when you tried to install or tried to use it? We are running business and can't afford any risk.

I have to say that the plugins I am promoting (the names are too many to list here) NEVER and EVER give error message, never let us down. Why, because we test them on different versions, we check forum discussions, we check trackers,  and I and my team have time to test them with many test users.

Also, we never give up to test some plugins which claims has the features we interested, even it failed in the last version, we still try their new version again to see if it gives error warning or not.