Specific Modification to Attendance Module

Specific Modification to Attendance Module

N Prasad - દ્વારા
Number of replies: 7

Dmitry's latest attendance module covers basically everything needed, including multiple sessions. I have used it good effect, but I need some assistance to change the same interface for only some small things.

This will make it COMPLETELY functional to our institutions requirements. See attached. They deal with the manage.php and sessions.php pages. I also want to change the Variable from radio buttons to input boxes.

When creating My Variables, it should be possible to be able to have input boxes instead of radio buttions to represent 'P', 'A' etc.

These are simple things that will add 100% functionality to our requirements. I have attached each as RAR files because of the attachment limit.

In reply to N Prasad

Re: Specific Modification to Attendance Module

N Prasad - દ્વારા
In reply to N Prasad

Re: Specific Modification to Attendance Module

Barry Oosthuizen - દ્વારા
Find this code in the manage.php file:

$table->head = array('#', get_string('date'), get_string('time'), get_string('duration', 'attforblock'), get_string('sessiontitle','attforblock'), get_string('subject','attforblock'), get_string('teacher','attforblock'), get_string('description','attforblock'), get_string('actions'), get_string('select'));
$table->align = array('', '', '', 'right', 'left', 'left', 'left', 'left','center', 'center');
$table->size = array('1px', '1px', '1px', '1px', '*', '*', '*', '*', '1px', '1px');

Change it to

$table->head = array(get_string('week'), get_string('startingdate', 'attforblock'), get_string('time'), get_string('duration', 'attforblock'), get_string('sessiontitle','attforblock'), get_string('subject','attforblock'), get_string('teacher','attforblock'), get_string('description','attforblock'), get_string('actions'), get_string('select'));
$table->align = array('', '', 'right', 'left', 'left', 'left', 'left','center', 'center');
$table->size = array('1px', '1px', '1px', '*', '*', '*', '*', '1px', '1px');

Now find this line:

$table->data[$sessdata->id][] = userdate($sessdata->sessdate, get_string('strftimehm', 'attforblock'));

Change it to:

//$table->data[$sessdata->id][] = userdate($sessdata->sessdate, get_string('strftimehm', 'attforblock'));


Find the file mod/attforblock/lang/en_utf8/attforblock.php

add this line:

$string['startingdate'] = 'Starting Date';


In reply to N Prasad

Re: Specific Modification to Attendance Module

Barry Oosthuizen - દ્વારા
The 'Session Days' are the days of the week in which the sessions occur. They are not the starting days. The 'Session Date' is the Starting date.

To get rid of the start time (why would you want to do this...?), you'd need to edit the add_form.php file. On line 18, change

$mform->addElement('date_time_selector', 'sessiondate', get_string('sessiondate','attforblock'));

to

$mform->addElement('date_selector', 'sessiondate', get_string('sessiondate','attforblock'));

I wouldn't recommend doing it though.

To change the labels on any of the screens:
  1. Go to the Site Administration block on the front page of your Moodle installation.
  2. Then go to Language > Language Editing > Edit Words or phrases
  3. Use the drop down menu to select attforblock.php (right at the bottom of the list somewhere)
  4. Edit the words or phrases you want to change and click Save Changes
In reply to Barry Oosthuizen

Re: Specific Modification to Attendance Module

N Prasad - દ્વારા

Our system works differently. We can already create groups of sessions and describe attributes such as Day/Time/Venue for a lab directly in the self-group selection tool. So this attendance module is not needed to do that anymore.

The module is used to generate weeks to grade, and the accumulation of the week scores appears in the grade book. To grade for a particular group we just switch to the group. We dont need to specify information such as duration etc, its useless.

The MOST important bit is to convert that radio button into an input text box where figures can be entered rather than as buttons. If my variables page can have a field Input Type with options check box/radio/text box, and have that integrated with attendance.php so that when taking attendance, those variable fields appear as those types. Hopefully there is a validation feature already there so that values outside min/max cannot be entered into a text box.

I implemented the other features myself even before you posted. Actually they are simpler than I thought. But since everything is dynamically generated, its difficult to track how to change the type to text box and have the user enter values and grading happen as normal with entered values in the range.  It would be great if a field called 'Input Type' is created in 'My Variables' and then it creates attendance taking as anyone would please. I believe that would be great to any institution that prefers whether to enter values (because there are different grading criteria depending on institution)

Thanks for the input and hopefully I get to change the radio button types.  

In reply to N Prasad

Re: Specific Modification to Attendance Module

Barry Oosthuizen - દ્વારા
OK, if you implemented the features yourself before I posted, I will leave the rest to you as well since you are a web developer and I'm just tweaking the code.
In reply to Barry Oosthuizen

Re: Specific Modification to Attendance Module

N Prasad - દ્વારા

Ok great. I just need to convert those to text boxes There is a remarks field. I can make another field just like that, (I have done that) however, it would be better for users to choose options of whether they want radio buttons or text oxes themeselves. If you are able to add that to My Variables, please let me know.