I am creating an evaluation webform where students evaluate both instructor and lab location on the same form based on class section number.

How do I redirect students to the correct form if there are 100s of sections?

Writing conditional based logic on global $user and checking for roles seems trivial. Login Destination will do the trick, but not sure how to handle 100s roles.

EDIT: The url structure would something along the lines of:

class/section/instructor or class/section/lab

Caveats: One instructor could belong to many sections since they can teach any number of classes.

Edit #2 Main entities/fields on the form are:

Instructor: can belong to many classes and sections

Class Name: i.e. Industrial Economy. A single class can have many sections (or units in laymen's term).

Section: belongs to a single class.

Class Number: Classnumber-followed by section number ie. ABC23343-34 (the last two digits are class section).

Key identifier and workflows:

Once a student logs in, he/she should see the list of classes they belongs to and fill out the evaluation form for that section. Essentially, a single student could have 5 or 6 forms. Apologies! this changes the question a bit. Actual form content stays the same (so a single form could be used as a template to attach to many entities).

  • 1
    Why do you have 100 forms? Why not just one form with maybe conditional fields? wouldn't having all data together make it easier to process it later? I believe problems like this indicate there might be serious design mistake earlier. – Mołot Sep 2 '15 at 14:23
  • You may be right in terms design flaw. But we want each instructor to be able to access the evaluation results later. Thus the individual forms... – JT-Drupal Sep 2 '15 at 14:30
  • Taxonomy might be the solution instead of "roles". Add the taxonomy to the user entity as well as the webform (node) entity. Then you can associate the two, and use some smart redirecting based on taxonomy. I guess the vocab would be "instructor" and each instructor's name is a term in that vocab. So then a form, and a user (student) each belong to an instructor, therefore you have your connection. – Beebee Sep 2 '15 at 14:34
  • You can even use Taxonomy Access Control module to restrict access to each form if you want to take it a step further. – Beebee Sep 2 '15 at 14:37
  • @JT-Drupal To be honest, I'd go with my own custom module here. But if Views support for Webform results is finally working as it should, I'd consider using one form and contextual filter on results to provide review limitations. – Mołot Sep 2 '15 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.