Recommendation system

Events happening in the community are now at Drupal community events on www.drupal.org.
one_hoopy_frood's picture

I am currently working on something that has to be done by April 15.

I am new to Drupal, but have basic database knowledge and more basic PHP knowledge.

I'm working on figuring out how to have an applicant send out a notice to a recommender to write a letter of recommendation. The reviewer would follow the link, make an account, see some information the applicant put on it (like, "I waive my right to see this application) then somehow upload a file so that it gets attached to the applicant's application.

For simplicity's sake, I would like to try to keep the application to one node. I'll have to move this through several states. Is there a way to bury a user's OTHER nodes into the BIOGRAPHIC node?

Solution idea one (at least 2 content types):
Allow applicants to make 'recommendation request' nodes wherein they send out invitations to recommenders. The file gets uploaded to the node (student cannot see recommendation) and the applicant can somehow see that there is now a file attached.

How could I make a single-invitation thingie like that?

I'm getting super-worried about this one ... and don't know if I can finish it up in time partly because I don't know how to build out the node system.

Module? Multiple nodes? Single node with nested relationships to the recommendation nodes?

Thanks for any help,
Chris

Comments

This isn't too bad

Lee-'s picture

If understand what you want, you will need a custom module to handle some bits of this in a proper manner. What would require customization and what existing modules you could make use of depend on what features you want, but if you're new to Drupal you may not have considered some aspects as to how Drupal handles users, roles, and permissions. Some specific items that you may have overlooked, but should be considered:

1) Can anyone register on this site or just those who receive a special link?

2) Of those who are registered, can any registered user leave a recommendation?

3) Of those who can leave recommendations, can they leave a recommendation for any other user, or just those who have specifically requested them to leave a recommendation.

4) Can a user who created a recommendation edit or delete those recommendations?

You could link the recommendations in to the user's biographic node, but this would complicate things like editing or deleting recommendations, although it may simplify some other things depending on the rest of your site.

There are a few other details depending on how you want it to work. If you're looking for "just make it work in the simplest way possible" and don't want to allow someone to edit their recommendations then you could do something like the following:

1) Write a module that allows a user to send a recommendation request. This module would generate a random number (recommendation request code) and store it in a table.

2) Recommendation request code would be emailed (as part of a URL) to the person who is to write the recommendation.

3) Module would provide validation of the recommendation request code (and to which user it is linked).

4) Module would provide a form that would allow the person to fill out information/upload a file.

5) On submission, your module would either append this to the student's biographic node or create a new node (and use a node reference with your biographic node) or whatever other method is appropriate based on your content type architecture.

This is just intended to be a general overview, but I hope it helps you to understand a potential method of making it happen. There's really several parts which are unique to Drupal. The rest is just generic PHP.

1&2) The recommendation code generation. There's a module called "invite" that I think may have code related to this that you can use as a reference. It's really just inserting a random code in to a table with a user id of the student and perhaps a timestamp so that you can expire the code.

3&4) Need to execute a function (which will validate the recommendation code) when the user goes to the special recommendation request URL. This is done with the hook_menu Drupal API. You would also need to use the Drupal forms API and if you choose to create a new node, utilize the existing node/add form.

5) Create a node and link it to the biographic node/append data to biographic node.

I would also recommend that you register the user prior to providing them the form to submit their recommendation. This would allow you to more easily track users who write recommendations, editing, future contacts and integration with the system, etc.

I'll start thinking about it like that.

one_hoopy_frood's picture

First, thank you for taking the time to write the reply. That was comprehensive, and it is appreciated.

First part of your reply:
Registration I see as a slight issue, but it's not a huge deal.

Anyone can make an account on the system.
There are 2 roles: applicants and recommenders
(There is another role: reviewer, but it will be assigned manually.)

Applicants are the only people who can make an application node.

In my scheme, I want recommenders to just be able to respond to the link they are sent so they can submit a file onto the applicant's application.

Each applicant will have to fill out an 'application' content type I created with CCK3 . On it there will be a lot of just biographic questions.

I think what's driving me nuts is trying to figure out the PHP AND put it in terms of Drupal. There's a lot of Form {array -> $foo { .... stuff that I just don't seem to understand where things are coming from and going to.

Thanks. I'll be playing with this. =)

Chris

Some progress without custom module

one_hoopy_frood's picture

After a lot of reading I found the following video on Mustardseed:

http://mustardseedmedia.com/podcast/episode37

This is essentially exactly what I want to do. With field permissions locked down to roles ... I should be able to make a content:recommendation node, send out a link to a role:reviewer using workflow, and prevent the role:applicant from editing the node afterward.

The nodereference portion takes care of relating the child node to the parent node.

But, I need each node:application to show all the associated node:recommendations on each applicant's node:application.
Views Attach Module:View:Display=Node Content

The view now needs to be limited to show only children of the parent node ... and the secret is:
Views -> Argument -> Content: Page Reference

This forces the embedded view to show only children nodes who "match parent node", which is what I want. The boon is I should be able to also select fields in the view I need to show only to applicant, one of which could just check if a file exists. If not, rewrite when empty to say "not received" and when present to say "present".

(it should also enable hand-scanned pdfs of recommendation letters (hard copies) be attached by the role:manager, who will need near-unlimited access to the system.)

Small outstanding issue:

Lock down node to ONLY invited recommender.

So, I think the only thing I need right now is to somehow 'lock' the node so that ONLY the role:recommender person who received the email to upload the recommendation can access that specific content:recommendation. Other role:reviewer entities should not be able to see it.

Maybe make a view that relates the account:email address of the role:reviewer to only node:recommendations in which the content field the role:applicant fills in to send the invitation email in the first place? Thoughts?

Now, I have not yet actually made this ... but I think I can do it now.

Will anyone help me if I need help at the APR 10 DrupalPGH meetup? ;)

Pittsburgh

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: