Hi,
I am trying to create an examination timetable. I would like the user to click a menu item, Exam Timetabe in order for this view/table to be shown..
I would like it ot be displayed as follows :-
Academic Year : user will select the year eg. 2006-2007 or 2007-2008
Semester : user selects 1 or 2
Info will be displayed as follows :-
Academic Year Semester Course Code Date Time Location
2007-2008 2 cs25a 22/04/2207 1:00 pm Room 313
2007-2008 2 cs45c 27/04/2207 1:00 pm Room 212
2007-2008 2 cs65b 28/04/2207 1:00 pm Room 313
This will be presented separately for Math and Comp Sc. courses (2 separate "table views" filtered by taxonomy terms Math or Comp Sc.).
I used a CCK node type, Exam Timetable Entry to create the examination info (as shown above) for a course
I used views to create the above display. I used 2 exposed filters to allow the user to select (1) the Academic Year (2) the Semester.
But, it seems as if there is no way to prevent the user from entering garbage as values.
How could I force the user to select 2006-2007 or 2007-2008 for the Academic Year ? say, from a list..
Similarly, how could I force the user to choose 1 or 2 for the semester ? from a list...
Is this possibe ? Is there another way to do this ?
I explored table manager for this .....didn't like it. not flexible in terms of mainternance..would need to periodically delete records etc
I explored the use of the Event Module for this, that is, display the entire month, and the course examination info will be displayed on the respective day cells. I was able to do this using the content_type filter etc.
In this method, how could I force the display of the month-view calendar display of these exam info when the clicks Exam Timetable.
Does anyone have any ideas ? Is this simple to do ? Am I doing this the wrong way ? Could I get some ideas please....thanks
Comments
Anyone ?
I've searched alot for any other approaches/help......nothing substantial.... Anyone with any ideas?
Taxonomy & dropdown lists
One approach would be to define an appropriate taxonomy:
Semesters
Then each of your timetabled classes get tagged with the appropriate semester.
Then you can create a dropdown list that will take the user to the appropriate timetimble.
I can't find the post that explains this, but here is the code for the dopdownlists from my own site:
The sql required to generate the dopdown list would be something like: this (but I use flexinodes, you'll need to determine the correct SQL for cck).
I hope this helps, or gives you a place to start researching further.
Cheers,
--
tys
BLUE MOUNTAINS health & harmony
www.health-harmony.com.au
building an alternative health & spirituality community in the Blue Mountains
Not a PHP coder but...
Thanks alot for the feedback....Sorry to say I'm reasonably new to Drupal...completely new to php . So, I'm struggling with your code.
One question - Wouldn't it be a bit inefficient to build the taxonomy as suggested ?? ..term/s for each academic year and semester...it would grow overtime... My thoughts were to enter these as data items to be used in manipulation for viewing and display purposes, that is, in calendars, views etc.. I'm not sure.
Anyway, I'm not asking for any explanation of the php but would you be able to briefly explain these lines
foreach($rows as $v1){
echo "".$v1[1]."";}
I think v1 is an array. Where does it originate ? Hope this is not asking too much. Thanks again for your help..
The taxonomy will grow over
The taxonomy will grow over time, but you can "unpublish" the terms that are no longer relevant.
In a way it's efficient becuase Drupal does all the work for you. Otherwise you would need to create the tree structure yourself - which you can do, but since taxonomy does tree structures so well, why not use it. The other thing is that years & semesters do form a natural structure. If you create the taxonomy as suggested, users can also browse the taxonomy tree rather than using the dropdown lists.
I've just realised that you want to show a view as the destination page, rather than a list of nodes dictated by a taxonomy grouping. Maybe in that case you should hand-code the drop-down.
Anyway, for your edification:
prints out the name and the link required for the dropdown box.
$rows is all the entries in your dropdown list. It is composed of smaller arrays.
The foreach extracts each of these smaller arrays into $v1
$v1[0] is the destination page (in this case a taxonomy page). I suppose you want a view page instead.
$v1[1] is the name to appear in the dropdown list
This code from the SQL part builds the array $rows from $node, which is the information about the nodes returned by the SQL query.
$row here is the same as $v1 above (don't ask me why, I just cut and pasted the code, okay ;))
'node/'.$node->tid
is the path for the appropriate taxonomy page
$node->name
is obviously the name of the destination node.
Well, this probably doesn't help you that much, except it shows you how to build a dropdown list...
Cheers,
--
tys
BLUE MOUNTAINS health & harmony
www.health-harmony.com.au
building an alternative health & spirituality community in the Blue Mountains
Moving along slowly
Thanks again for your feedback...I need to work on my php...alot. I'll try my best using your discussion/code example. I will work on it from here.
1 last question : Are you familiar with any resources (drupal pages etc) that provide an understanding of how to use php to populate dropdown lists (like your code), select lists etc...additionally, how to capture and use the value selected, clicked on form components (CCK) etc. I have been searching without much success.
Thanks again.. really appreciate it..
New idea + some links
Found this. Could be what you're after dependantDropdown
I just had the thought that maybe you could do what you want by using the menuing system.
It also maintains tree structures. And what you are trying to do is provide a navigation tool, so it might be the right place (although it feels like a bit of a hack from my perspective)
Create a menu in admin>menu
Create a top level menu item for each year, then menu items below for the semesters. Each semester menu item should link to the views page you've defined.
Now you can populate a dropdown from the menu's table (rather than taxonomy).
It means that there may be some issue with the year menu items (since they don't actually link to anything ), and perhaps your breadcrumbs (as the year may appear in the breadcrumb, but not actually have a page associated with it).
Anyway, here's some links for you (althoug most are associated with categories, becuase that's my experience).
Taxonomy Drop Down Select Jump Menu
Vocab/Terms 2 Level Dependent DropDown Select List
Drop Down Box Dynamically Filled With Taxonomy
Some menuing stuff:
An Excellent Drop-Down Menu Module
Turning primary links into a horisontal dropdown list w/just CSS
Hope that gets you started.
Happy reading,
--
tys
BLUE MOUNTAINS health & harmony
www.health-harmony.com.au
building an alternative health & spirituality community in the Blue Mountains
Check also this new
Check also this new module:
http://drupal.org/project/hierarchical_select
demo here
http://wimleers.com/demo/hierarchical-select
---KOBA - Webdesign with Drupal
KOBA - Drupal Webdesign & Webdevelopment
Subscribing, greetings,
Subscribing, greetings, Martijn