Add the ability to take attendance for each gradebook daily.

Features

  • per class/gradebook
  • once per day
  • admin interface to reconcile attendance at the end of day
  • integrate with views

Implementation

Basically this would add either a link or button to take attendance right above the gradebook when viewing it. If attendance had already been taken that day then the link won't show up. The page that takes the attendance will get the students in the gradebook using the gradebook api (possibly og_gradebook). Then it will allow the teacher to input for each student present, absent, or tardy. At the end of day a secretary of the school can go to an administrative interface to reconcile the attendance for that day. Basically this person would choose whether the absence/tardy was excused or unexcused. Finally students/teachers will be able to view the atttendance records on the user page of the student.

I would love to create this module to extend gradebook but I would like some suggestions. One of the things I am deliberating about is whether these attendance records should be nodes. I would like to hear what everyone thinks about this and other aspects.

CommentFileSizeAuthor
#21 gradebook_attendance.zip2.13 KBjdwfly

Comments

MGN’s picture

Version: master » 6.x-2.x-dev

Sounds like this would be a helpful addition.

A couple of thoughts:

I like the idea of a connection between the gradebook and attendance record. Is it possible that the attendance record itself might also factor in the grade? Should it have an associated taxonomy term in the gradebook vocabulary?

The frequency of classes may not be daily - it might meet twice a week or three times a week, so this should be part of the configuration. Optionally, the teacher might not need to select the date at all. Just add an attendance entry whenever the teacher decides to take attendance (i.e. it needn't be at regular intervals).

Rather than above the gradebook, you might want to pop open a new window that closes when class attendance is submitted.

Are additional permissions necessary, or is 'administer gradebook' not too broad for the person selecting excused/tardy? You could either handle this through drupal role, or gradebook roles...

What is the argument for the attendance records being nodes? I am not sure I see the benefit in that.

jdwfly’s picture

The attendance could factor into the grade. I am not exactly sure how one would grade attendance. There would obviously be a total amount of days they should have been present. That could be divided by the days they were present plus excused absences. They should obviously not get credit for days they were unexcused. If that is linked with a taxonomy term then someone could easily set it as a certain percentage of their grade.

I realize that the frequency of the classes may not be daily, but the link would be there every day until they take attendance for that day. If the class doesn't meet then they don't need to take attendance. So attendance will only be taken whenever the teacher takes it and the date it is taken is the date of the record.

My suggestion was for a link to be above the gradebook, which when clicked it would lead to a page to take attendance. The attendance would not be taken on the same page. Once the attendance is submitted they go back to the gradebook page. I don't know that I would like the pop-up idea, but if others mention it I may be inclined to take that route.

The problem with selecting excused/unexcused for an absence or tardy is that most likely a teacher will not know this. This will need to be done by an administrative secretary that is keeping track of this. This may be unnecessary if you are just wanting to keep track of absences in a smaller setting, but if a school is using this to manage attendance I believe they will have a secretary keeping track of excused/unexcused absences/tardies.

I didn't want them to be nodes either.

MGN’s picture

It sounds like we agree. I think this will make a nice submodule. If you want to try to code this, I would be happy to help out as needed and evaluate the code when it is ready.

jdwfly’s picture

I'll begin work immediately and I'll post it as soon as I can get it's basic functionality working.

jdwfly’s picture

Assigned: Unassigned » jdwfly

I am trying to figure out where the best place would be to insert the link to take attendance for a certain gradebook. So what do you think about that link on the gradebook page? Do you think that is a good idea? I really don't know where else I would put it.

The only way I know how to put that link there is to add some code into gradebook.module. Is there a way around this or do you think the link should go somewhere else?

MGN’s picture

Yes. I figured you would be getting to that question soon. I agree that gradebook needs a hook to allow submodules to insert links on the gradebook page. How about adding something like the following block in theme_gradebook_page()

  $output = '<div id="gradebook-container">';

  // This block allows submodules to add links to a link-bar above the gradebook grade page
  $output .= '<div id="gradebook-grade-page-links">';  
  $addlinks = module_invoke_all('gradebook_grade_page_links', $gradebook);
  $output .= implode(" ", $addlinks);
  $output .= '</div>';

  $output .= theme('gradebook_table', $headers, $rows, array('class' => 'gradeb\
ook'));
  $output .= '</div>';
...

and then in the submodules we can do something like (I am working on roster now, so you'll want to adopt your own version of this function appropriate to attendance)

/**
 * Implementation of hook_gradebook_grade_page_links().
 */
function gradebook_roster_gradebook_grade_page_links($gradebook) {
  $links = array();
  if (gradebookapi_is_teacher($gradebook)) {
    $link = l('roster', 'gradebook/'. $gradebook->tid .'/roster');
    $links[] = $link;
  }
  return $links;
}

What do you think? Would this be sufficient?

jdwfly’s picture

I think that is exactly what I was trying to suggest. I haven't actually made any modules that had their own custom hooks. Is this how you are going to name the hook? I just want to be accurate when I am creating my module.

MGN’s picture

I think this name can work. It makes for long function names, but its also clear what they do. This code also makes it easy to customize the format via gradebook.css.

jdwfly’s picture

What does your hook_menu function look like for the roster module? I keep getting an access denied error and my hook_menu function should probably look very similar to yours.

/**
 * Implementation of hook_menu().
 */
function gradebook_attendance_menu() {
  $items['gradebook/%/attendance'] = array(
    'title' => 'Take Attendance',
    'page callback' => 'gradebook_attendance_take',
    'page arguments' => array(1),
    'type' => MENU_CALLBACK,
  );
  
  return $items;
}
MGN’s picture

Looks like the wildcard is off....gradebookapi_is_teacher needs the taxonomy term, not the term id....

$items['gradebook/%gradebookapi_gradebook/roster'] = array(
    'title'            => 'Roster',
    'page callback'    => 'drupal_get_form',
    'page arguments'   => array('gradebook_roster_page', 1),
    'access callback'  => 'gradebookapi_is_teacher',
    'access arguments' => array(1),
    'weight'           => 0,
    'type'             => MENU_CALLBACK,
  );
jdwfly’s picture

Thanks, this helped me figure it out.

MGN’s picture

@jdwfly. I've just updated Gradebook and a few things have changed that might affect your development of this submodule. 1. Submodules are now in their own subdirectories for better organization. 2. I've changed hook_gradebookapi_get_students and hook_gradebookapi_get_teachers a little (see CVS messages, Changelog file, etc for more information).

You can continue developing with the pre-April 1, 2009 version, and I can adjust things to work with the new dev. I just wanted to let you know that there has been some changes to the api...

MGN’s picture

Also note that this affects og_gradebook as well. Next time you get the latest gradebook-6.x.2.x-dev, be sure to also get the latest og_gradebook-6.x.2.x-dev release!

jdwfly’s picture

Thanks, I'll make sure to check out the new version. I haven't been able to get very far in development (actual coding), so it shouldn't be a huge issue. I'll have some time over the next few days, and I am hoping to have a working version.

jdwfly’s picture

I have made good progress on the module so far, but the theme process is a little tricky. Basically I am using a form, but in order to make it look nice I really want to lay it out in a table some what similar to what the permissions page looks like. I have been reading the code for that, but I haven't been able to make it work yet.
All the attendance page needs to have on it is the student name in a column and then a select field with the options to choose (absent, present, tardy). It's easy to use the default layout of a drupal form, but it would look nicer if I could use the theme('table',...) function on it. Maybe you are doing something similar with your roster page?

MGN’s picture

You can follow the example in gradebook.module and gradebook.pages.inc for the gradebook_grade_form (which is a themed table). The key steps to theming the form are to specify the theme function in the $form array like $form = array('#theme' => 'gradebook_grade_form');,

and then theme the form in a function like function theme_gradebook_grade_form(&$form), using drupal_render to render the form elements. These can be placed in the rows of a table, which can also be themed. Have a look at theme_gradebook_grade_form to see how this is done.

Finally, remember to use hook_theme (as is done in gradebook.module) to tell the theme layer about your new theme function.

That should do it.

jdwfly’s picture

Thanks for the help MGN! I was able to follow your code and make my own theme function for my form. I now have the basic functionality done. I'll be working on the admin interface to it as well as integrating a page in with the user page.

zietbukuel’s picture

subscribing
very interested in this module, any news?

jdwfly’s picture

Actually I finished this months ago, but never put it up here because I didn't think it anyone wanted it. Let me go fish it off my hard drive and see what needs to be done to make it ready to go.

MGN’s picture

Thanks jdwfly. I am also still interested - just been working on other things lately. I'll be happy to have a look and work it into the 6.x-2.x-dev release when its ready.

jdwfly’s picture

Assigned: jdwfly » Unassigned
StatusFileSize
new2.13 KB

Here is what I found. I don't think this was my most recent development though. Sorry, but this is all I've got.

MGN’s picture

Status: Active » Postponed (maintainer needs more info)

Thanks, I am reviewing this now. Do you have a gradebook_attendance.install file to create the new database table? If you do, please attache it. Otherwise, I am sure I could figure it out from the module file.

MGN’s picture

Reading through the code, I think this is a good start. I think it would also be helpful to provide an attendance summary page, with an option for including attendance in the gradebook (i.e. either as an attendance category so it can be counted as an assignment and tallied into the course grade). The summary page should be accessible from the gradebook link, available for the teacher as well as the student.

MGN’s picture

Status: Postponed (maintainer needs more info) » Active

The gradebook attendance module is now part of the 6.x-2.x-dev package. I started with jdwfly's code and then further developed it. One significant addition is the option to create attendance assignments - automatically assigning points to a gradebook category for student attendance. Here are some details that are now part of the README.txt file.

4.  Gradebook Attendance provides a means for recording student attendance and
    provides an attendance page that is similar to the gradebook page. When this
    module is enabled, students and teachers will have an Attendance tab when
    viewing the gradebook page. Clicking on this tab will take them to the
    attendance page. Student's will only see their own attendance records.
    Teachers will see the records for the entire class and will be able to edit
    or create new attendance records. Also, if attendance has not already
    been recorded "Take Today's Attendance" reminder link will appear above the
    gradebook page that will take the teacher to a form where they can record
    attendance.
    A. The teacher can choose to give a student one of three marks: Present,
       Absent, or Tardy.
    B. Attendance records are limited to one per gradebook per calendar day.
    C. Attendance records for the entire class can be edited or deleted by
       following the "edit" or "delete" links on the gradebook attendance page.
    D. An individual student's attendance record can be changed for a given day
       by clicking on the attendance record for that day.
    E. An individual student's entire attendance record can be edited by
       clicking on the student's name on the attendance page.
    F. The attendance page can be exported to ascii text or Excel spreadsheet
       through the Export tab on the gradebook page.
    G. Teacher's can create an attendance assignment that will provide points
       for student's attendance when attendance is taken over a range of dates.
       This is done by checking the "attendance assignment" box on the form when
       creating an assignment. If this box is checked, then the points specified
       in the "Points if Present, Absent and Tardy" fields will be given
       whenever attendance is taken between the publish and due dates for the
       attendance assignment. Grading is automatic. The grades are also updated
       if the assignment is modified. A special (themeable) notice is also shown
       on the assignment node explaining how attendance is graded.
    H. Attendance records are emphasized on the attendance page using a css
       style. The default emphasis can be adjusted by overriding or editing the
       gradebook_attendance.css file.

I think that everything, except views integration, from jdwfly's initial feature list is present. I'll leave this issue open as a reminder to follow up with views integration.

AntiNSA’s picture

Awesome. I am wondering a bit if you can go into detail about the daily attendance assignment part? I

I am trying to give my students a daily blog writing assignment. Is this how the attendance assignment functions?

Also, can you create different than teacher permission levels to allow class monitors to take attendance, but not let them alter grades?

MGN’s picture

The attendance assignment was designed with the idea of taking class attendance, but I suppose it could also be used for your daily blog writing assignment. There are only three levels of grades provided - present, absent and tardy. If that is sufficient then each day that a blog writing assignment is do, you can "record attendance" and give each student a grade. You specify how many points for each grade category, and the gradebook possible points and earned are automatically updated for each student.

I think I could generalize this module to better provide for use cases similar to this. Perhaps changing "attendance" to "repeating" would make sense. Then attendance would be one way to specialize it.

I also like your idea to grant some gradebook roster roles the ability to take attendance.

AntiNSA’s picture

hmm.. Maybe attendance and repeating should be kept different submodules. If possible create a task/assignment category, which gives set number of points for automatic task completion, and you could set the number of allowed tasks per day and maximum allowed task responses. if possible a drop down box of allowed points in the range of the daily automatically given points.....

That way you can say a daily blog would automatically be scored a 10, however during random spot checks and assigned peer monitor checks , they could use a drop down box with points 1,2,3,4,5,6.7.8.9.10 to edit the automatically scored blog. The drop down box would save steps required to edit a commonly reoccurring process.

marilynmorado’s picture

Title: Create an attendance sub-module » Attendance Recording
Priority: Normal » Major

If you need an attendance recording system I recommend using http://www.ghg.com I use them for my company for my employees and when we have festivals to keep track of people, supplies, etc.

AntiNSA’s picture

Im going to try the gradebook attendance module... I really need it integrated and it is now.. I just havent had a chance to test this yet. I need to it is on my l ist of things to do.

karensmallwood’s picture

Great module - thanks

MGN’s picture

Priority: Major » Normal
Status: Active » Closed (fixed)