Moodle: Dynamic role assignment based on quiz result - plugins

is it possible to perform a dynamic role assignment based on a quiz result in Moodle?
How it should work:
- a new user answers the questions in a special "startup" quiz
- based on the result, the user is granted some kind of mentor role
Is this possible with existing Moodle plugins or would I have to implement it by myself?
Thanks in advance :)

Not possible with the standard tools, but you could write a small local plugin that had a cron job which would scan the quiz results and assign a role based on the criteria you set.

Related

How to integrate existing mongodb database to current project?

I am trying to create a workout app api using express, and mongodb. I plan on creating a list of exercises so the users can see all of them on the app, but the exercises can also be part of a workout created by the user. Users could also add their own exercises, but these will not be added to the default list of exercises created by me. My question is. If an user is creating a workout, how do I add an exercise from the exercises list database to their own custom workout. I am sorry if this does not make sense, please ask me any questions and I could clarify more.
At a high level, I would suggest that you create a database for all standard workouts that you have. Besides that you will create a database for each user in which you can add the custom workouts that he/she choose. Databases will have the exercises as records.

Assign New Leads of Existing Accounts to Account Owner

Salesforce - Apex Trigger for New Leads for Existing Accounts. How?
Hello,
I would like to write an Apex Trigger to check if a new lead's COMPANY or NAME already exists as an ACCOUNT, and therefore assign the new lead to the proper ACCOUNT OWNER.
Is there a formula that anyone can provide me to make this happen?
It would be great if the formula would look for CONTAINS "ACCOUNT NAME" rather than a direct match, for cases where a new lead submits their company name in a format slightly different than our existing ACCOUNT NAME.
Thank you greatly for your help.
I don't think this can be done with just a formula. You will need a trigger, preferably one that calls an apex class to do the work. The class will have to be without sharing if you want to reassign the owner id. You'll have to query account for this.
I don't know if anyone is still following this thread, but a client recently asked me for something similar. The client wanted new Leads to be assigned to the same Owner as an existing Contact with a matching email address. Standard Salesforce Lead Assignment Rules didn't support this, so I implemented it using Process Builder and Visual Workflow. There was no need to write Apex code.
It was straightforward and reasonably quick to do, so I put together a blog post outlining the steps. Hopefully someone will find this useful in future.
https://alearningdiary.com/2017/11/12/assign-a-lead-in-salesforce-based-on-existing-contact-owner/
Brian

How to create user profiles with Bottle and MongoDB?

I want to set up user profiles in a Python app that is using Bottle and MongoDB.
I've searched for:
create users profile in bottle python
But the majority of links relate to Flask.
I'm new to Bottle and need a 'from the ground up' introduction to the particular topic of user profiles in Bottle.
I understand that routes are used to trigger functions, and have got several of these routes and functions working.
I'd appreciate it if anyone could provide a newbie friendly guide to understanding and implementing user profiles within the Bottle framework in a MongoDB environment.
There are a couple of authentication mechanisms for Bottle that I've seen. You could attempt to use those user accounts as a starting point to build out a more robust profile.
Cork (authentication): http://cork.firelet.net/
Bottle example user accounts: https://github.com/uvtc/bottle-example-user-accounts
This one might get you closer to what you need but will still require some work to integrate with MongoDB.

Creating a user controlled data service with Google App engine

I am designing a to-do list manager for the iPhone using GAE as the back end. My end goal is to create user sharable lists, and I was looking for some advice/examples of how to go about designing something like that. I know the google user API provides functionality for authenticating users, but from what I can tell any additional user management would be something I would need to implement myself.
Can something like this be done by simply adding usernames to a list that is a property of the data I want to share? I am guessing I am oversimplifying things, but any suggestions would be appreciated.
Thanks
you're right, app engine doesn't have any built in support for user ACLs or permissions, and a few quick web searches didn't immediately turn up any obvious open source libraries.
how to implement full-fledged permissions and ACLs for group sharing is definitely a nontrivial design question. there are a number of other questions here about it.
having said that, as a very rough first pass, you're probably on the right track with storing lists of users. i'd suggest that you abstract the list into separate Group entities, and attach those to yor data instead, so that users can define groups once instead of for every piece of data. i'd also consider storing separate lists of groups that can read vs write. finally, i'd store User properties in the group entities, instead of string usernames or email addresses.

How to add custom meta fields to moodle course elements?

I have a question: I'm trying to connect interrelated elements between two courses (calculus and physics) for students, and first step I'm going to do is to add custom fields for course materials and assignments, on which I'm going to keep id's for the elements of the correlated course element.
For example: student fails the test on Classical Mechanics and he's redirected on materials about derivatives on Calculus.
So, two question here:
1) how to add custom fields in Moodle.
2) how to request them via REST API in Moodle?
Thanks!
how to add custom fields in Moodle.
You should develop your own plugin, and it is not what can be explained in two words.
how to request them via REST API in Moodle?
This is also part of custom development