Jump to content

adrozdz

New Members
  • Posts

    4
  • Joined

  • Last visited

adrozdz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. First of all I didn't ask for any code, but guidelines how to achieve some goal beacuse I didn't have any cule then how to work it out. Second of all next time I visit this forum I won't forget go take ma wallet with me.
  2. Thx Barand for the answer but unfortunalety the situation has changed and another solution is expected. Forget the main client i have only workers connected with clients, there will only be "regular" clients . And my clients wants to choose how many clients workers must assess. Of course clients have to be assessed more or less proporionally. But I'm sure there will be a situation where workers don't have assigned clients or have less assigned clients than chosen quantity. I don't know if any of this makes sense This project is written in Yii2 Frameword if it gives any help.
  3. Sorry my bad. General number of randomly choosen clients should be more or less the same for each clients. What I mean is that there should be equal number of surveys for each client. Sorry for my English. Maybe other words: There shouldn't be a sitiation where one client is evaluated f.e 10 times and another one only once.
  4. Hey everyone, I have a question, and I don't know if it's even possible to achieve. I have clients and workers, each worker has a "main client" who is the most important client for this worker. Also each worker can have other clients assignet to him and one client can be assigned to many workers. The schemma looks more or less like this: A - assiged to each other M - main client Wx - Worker Cx - Client | C1 | C2 | C3 | C4 | C5 | w1 | M | | A | A | A | w2 | A | M | | A | | w3 | | | A | A | M | w4 | A | A | | A | M | w5 | A | | M | A | | w6 | | A | M | | | w7 | A | M | | A | | Now, I want assign a survey for workers who would answer some questions about clients. But there are some rules - Each worker has to evaluate his "main client" - Each worker has to evaluate one client assigned to him excluding "main client" - Clinets has to be evaluated somehow proportional And with that third rule I have a problem. Without it I would create an array with main client and the other would be a result of the following code: $clientsToEvaluate = []; $clientsToEvaluate[] = $mainClient; //finding is easy /*gather other clients' ids and shuffle it*/ shuffle($otherClients); $clientsToEvaluate[] = array_slice($otherClients,0,1); But I don't know how to implement the third rule (to make it proportional). Do you happen to know how to solve it. I'd be very grateful foe each suggestion.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.