Giter VIP home page Giter VIP logo

moodle-mod_attendance's Introduction

ABOUT

The Attendance module is supported and maintained by Dan Marsden http://danmarsden.com

The Attendance module was previously developed by Dmitry Pupinin, Novosibirsk, Russia, Artem Andreev, Taganrog, Russia.

Branches

The following git branches are supported:

Moodle version Branch
Moodle 4.1 MOODLE_401_STABLE
Moodle 4.2 MOODLE_402_STABLE
Moodle 4.3 MOODLE_403_STABLE
Moodle 4.4 MOODLE_404_STABLE

PURPOSE

The Attendance module allows teachers to maintain a record of attendance, replacing or supplementing a paper-based attendance register. It is primarily used in blended-learning environments where students are required to attend classes, lectures and tutorials and allows the teacher to track and optionally provide a grade for the students attendance.

Sessions can be configured to allow students to record their own attendance and a range of different reports are available.

DOCUMENTATION

https://docs.moodle.org/en/Attendance_activity

moodle-mod_attendance's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle-mod_attendance's Issues

Use Moodle langconfig for dates display format

Instead of storing the date format in the attendance lang files, I think you should use the global strftimedatetime from Moodle langconfig file (ex: get_string('strftimedatetime', 'langconfig')). Right now, with fr_ca language, we must go into the language file editor for module Attendance and set our format correctly for the 6 time format used by the module.

copied from: https://tracker.moodle.org/browse/CONTRIB-5549

Responsiveness for table views

As we implemented a responsive theme within our moodle, it showed up that the displaying of the tables in your plugin is not responsive.
I just wanted to request, if there could be development towards responsiveness?
attendance_listview_on_smart_device

Improve support for multilingual sites

There are a few changes required in order to make the Attendance activity module useful as I am implementing it on a multilingual site with multilingual courses:
These changes will enable course, activity names and labels to be processed through Moodle filters and displayed in the appropriate language when using multilingual syntax.
FYI: I am using the Multi-lingual Content filer which uses
{mlang} tags.

  1. At the moment, activity names and course names are not being filtered through Moodles filters.

To fix this, please replace all instances of:

$course->fullname
with
format_string($course->fullname)

... and ...

$att->name
with
format_string($att->name)

...in each of the following files:

  • attendance.php
  • export.php
  • manage.php
  • preference.ph
  • report.php
  • sessions.php
  • take.php.
  1. At the moment, even with the shorter {mlang}
    syntax of the multilangsecond, I still can't create a multilingual string in the status description fields because the form field and database field only accept 30 characters. For example, the following string is too long:
    {mlang en}
    Present
    {mlang}{mlang fr}Présent{mlang}
    Please make the "description" field wider in the form and the database. 255 characters should be plenty to enable support for multiple languages.
    Note: Additional application of the format_string() function may also be required but I won't know for sure until I can used
    {mlang}
    tags in the description fields.
    Your assistance in resolving this issue is much appreciated. Looking forward to implementing your next release!

This has been moved from:
https://tracker.moodle.org/browse/CONTRIB-5607

PHP notices when looking at reports where some of the students have not been marked

If you haven't done any decision about attendance of some of your students (P/L/E/A), and they are still marked with red font in a session view, then PHP throws a notice on each unresolved student when looking at Reports tab.

Notice: Undefined offset: 1 in /var/www/ilearn2test/mod/attendance/renderer.php on line 840

Can be fixed by just implementing some isset or empty check before trying to access potentially empty array indexes.

Attendance reports: some table columns too narrow for content

Hello:

First, thank you for this very useful module! Second, the Attendance Report page has a table layout and readability problem, especially when viewed in the Student role. Present across Firefox, IE, Chrome, and Safari browsers for PC. Have mod_attendance version 2014112001 installed in Moodle 2.7.

When viewed in an Administrator or Teacher role, the Attendance Report columns Date and Time are too narrow to easily read their content while the columns Type and Description are excessively wide.

When viewed in Student role, the Attendance Report columns Date, Status, and Remarks are only one character wide (very difficult to read) while the column Description occupies 80% of the table width.

Please see attached screenshots taken in Firefox browser (zoom view reset, zoom text only unchecked).

I'm hoping there is an easy CSS style sheet fix to these column width problems. Thanks!
attend-rpt-student1-day
attend-rpt-teacher1
attend-rpt-student1-allpast

Change Dates to Fit American Format

Hello,

I am wondering if it were possible to change the way the dates are formatted (dd/mm) to the American format which is (mm/dd). We have had several requests from our users on this, and it has caused some confusion. I have attached a screenshot for your reference.

Thank you,

Ben Tindell

screen shot 2014-10-27 at 10 14 44 am

Exporting 'Common' Session type Sessions filtered by Group throws an error

Steps to reproduce:

  1. Create an attendance instance with "Visible Groups" setting
  2. Create sessions with Common Group type
  3. Export sessions filtered by a Group
  4. This throws an error as below
    groups_export_error

Expected behaviour:
The export should filter by group just like the Report page. I.e. filter by group members not filter by sessions tied to a group.

$PAGE->set_url() in sessions.php

In session.php, could you please make the following change:

$PAGE->set_url($att->url_sessions());

to

$PAGE->set_url($att->url_sessions(array('action'=>$pageparams->action)));

Besides the fact that $PAGE->url should never resolve to an invalid URL, the reason I ask is because I have a plugin which modifies the URL of the page to in order alter its appearance. However, because $PAGE->url doesn't include the action parameter, the page ends up displaying a message which says "A required parameter (action) was missing."

There may be other Moodle code which also expects a valid $PAGE->url.

Best regards,

Michael Milette

Feature request: Create Sessions with CSV Import

By creating a CSV file to import sessions we can easily produce large amounts of sessions without mistakes. Currently it's a little counter-intuitive. Any update to the session creation options might consider simplifying this step.

Scales not working?

Hey,

It appears that the scale option is not working?? Is it meant to be like this or this can be improved?

Use case: When scale is selected then in mdl_attendance the grade field is marked with "-[scaleid]".
Now when marks are added to users then they are not saved in gradebook. Because in locallib around line 890 is:
if ($this->grade != 0) {
$this->update_users_grade(array_keys($sesslog));
}

If the attendance module is not intended to support scales then the scale option in mod_form should be removed to avoid confusion.

Allow grade with decimal

As grades with decimals are allowed by Moodle, it would be a good idea I think to have attendance allowing it too.
We've made a quick patch in our Moodle and so far so good, everythings still working.
Change mdl_attendance_statuses grade column to decimal(10,5)
In \mod\attendance\preferences.php, set both $newgrade and $grade to PARAM_FLOAT instead of PARAM_INT on line #55 and #94
I know PARAM_FLOAT don't live well with comma as decimal separator but I don't know what the official Moodle way to handle it.

Copied from: https://tracker.moodle.org/browse/CONTRIB-5597

Upgrade from attforblock not updating itemmodule in mdl_grade_items

After upgrading our attendance plugins to use mod_attendance (instead of attforblock), we ran into a gradebook problem because the upgrade does not change the itemmodule values in mdl_grade_items to reflect the new module name. This part of the upgrade appears to be missing.

Clicking 'OK' button throwing errors

Hello,

We have stumbled across an issue with the plugin.
To replicate:

  1. go to the "Sessions" tab.
  2. click on the 'OK' button in the lower-right hand corner
  3. This will throw an exception like: [Fri May 01 11:42:05.795219 2015] [:error] [pid 1995] [client 127.0.0.1:44992] PHP Fatal error: Call to a member function display() on a non-object in /home/btindell/prj/moodle/git/docs/mod/attendance/sessions.php on line 178
  4. This will bring the user to a page that has nothing on it. Please see attached screenshot.

Hopefully this can get fixed before the next release!

Thanks!
Ben
screen shot 2015-05-01 at 11 53 51 am

Feature request: API for Attendance

Is anyone else interested in this? An API would allow Moodle Mobile or custom apps to provide more streamlined attendance taking by teachers using their mobile devices.

Attendance miscalculation in grade book

This is a very specific, but also misleading bug to both the teacher in the Grader report and a student in the User report. Here's a scenario I've created:

  1. I created an Attendance activity with a grade of 52.
  2. I then created 26 slots in the Attendance activity, each with a maximum of 2 points (hence the grade of 52 at the initial Attendance creation page).

Here's where the misleading behavior enters:

  1. I scored three Attendance slots for one student. Let's say I gave her the maximum of 2 points per session for a total of 6 points out of the 6 up to that point, though 6 out of the semester potential total of 52.
  2. After grading this student for three sessions, I see in the Grader report a 52 out of 52 for 100% because her running record is currently listed at 100%, even though she has only earned 6 points up to this point.

It seems the Attendance activity is calculating the total points earned based off the percentage of the cumulative total of all Attendance slots for the course (e.g., 5/6=83.33% so the Grader report would show the student having earned 43.33/52, which also equals 83.33%).

Attendance activities aren't visible after upgrade from mod/attforblock

We tested an upgrade from mod/attforblock to mod/attendance and the upgrade itself runs as expected. However, after the upgrade, when a user enters a course that had existing Attendance activities, those activities appear to have gone missing from the course. They do not show up in the activity listings in the course sections and the Attendance block contains a message stating that an Attendance activity needs to be added to the course.

The existing Attendance activities have not actually gone missing; they're just not in the old course cache because of the name change. Once something is done that generates a new cache, such as adding a new activity to the course, the existing Attendance activities reappear.

We cannot upgrade to the new module if the existing activities go missing. A step should be added to the upgrade process that clears the course caches so that users do not experience missing activities.

Expired self enrolments prevent attendance taking when active manual enrolments exist

Steps to reproduce:

  1. Add self enrolment method to a course (set to expire before attendance session)
  2. As a student self enrol on the course
  3. Create an attendance session which starts after the self enrolment expires
  4. Manually enrol the student on the same course with no expiry date
  5. Take attendance for the session
  6. The student above will be greyed out on the attendance register with "User enrolment ends ## ## #### (date)"

deprecated message

Hi, i've got this notice when deleting grading scale

Please notify the developer of module "attforblock" that new function module_scale_used_anywhere() should be implemented.

line 307 of /lib/grade/grade_scale.php: call to debugging()
line 267 of /lib/grade/grade_scale.php: call to grade_scale->is_used()
line 77 of /grade/edit/scale/index.php: call to grade_scale->can_delete()

Attendance pageparams not initialised safely/sensibly

The current constructor for the attendance object is:

public function __construct(stdclass $dbrecord, stdclass $cm, stdclass $course, stdclass $context=null, $pageparams=null) {

This defaults the $pageparams to null.

If I instantiate this without a $pageparams object I then start getting lots of notices as the code starts trying to access various properties & methods like startdate, enddate and get_current_sesstype().

For example the get_filtered_session() function is just doing:

if ($this->pageparams->startdate && $this->pageparams->enddate)  {

which raises notices because the object that is meant to hold the startdate / enddate property is null.

If this is required or going to be expected to be available then it shouldn't have a default and /or should be initialised to something sensible!

I've got the case where I've got a web service that doesn't have UI and I want all the data so I've not passed any pageparams in.

(I was in the process of updating it as a contribution to this module as we've implemented access to attendance data via a web service call, when I found this)

Upgrade failing due to version having moved

On trying to upgrade from mod_attforblock to mod_attendance, we're getting the noupgradefromthisversion error even though the version we're trying to upgrade from is supported.

It looks as if this is because the version is no longer held in the module table, as of Moodle 2013092001.02 (https://tracker.moodle.org/browse/MDL-41437). Where the version isn't set on the record from the database the code should be checking the config.

Attendance module shows users enrolled with disabled enrolment methods

Currently the attendance module will show a student even if they are enrolled into the course using a disabled enrolment method. These students should not show as they are not enrolled students.
To replicate
Create a course and enrol some students, any enrolment method
Go to Course Admin > Users > Enrolment methods
Click on the eye icon to disable the enrolment method you just used.
Go into participants to verify those students are no longer in the course.
Add an attendance module, add a session and take attendance
EXPECTED: disabled students should not be listed
ACTUAL: disabled students are listed

This issue has been copied from:
https://tracker.moodle.org/browse/CONTRIB-5611

Fatal error

With the current master branch, I'm getting the following error when clicking on an attendance activity:

Fatal error: Can't use method return value in write context in /local/html/moodle2/mod/attendance/locallib.php on line 1073

It's complaining about this:

if (!empty($this->get_group_mode())) {...

We're running PHP 5.4.23, and prior to PHP 5.5, empty() only supports variables (ref. http://us3.php.net/empty).

This works:

if ($this->get_group_mode()) {...

Missing language strings

The following warnings are displayed on the blocks.php page in Moodle 2.5.2 when the attendance module has been installed:
Invalid get_string() identifier: 'donotusepaging' or component 'attendance'. Perhaps you are missing $string['donotusepaging'] = ''; in mod/attendance/lang/en/attendance.php?

line 6927 of /lib/moodlelib.php: call to debugging()
line 7619 of /lib/moodlelib.php: call to core_string_manager->get_string()
line 32 of /mod/attendance/settings.php: call to get_string()
line 3368 of /lib/pluginlib.php: call to include()
line 17 of /admin/settings/plugins.php: call to plugininfo_mod->load_settings()
line 6416 of /lib/adminlib.php: call to require()
line 177 of /admin/blocks.php: call to admin_get_root()

Invalid get_string() identifier: 'resultsperpage' or component 'attendance'. Perhaps you are missing $string['resultsperpage'] = ''; in mod/attendance/lang/en/attendance.php?

line 6927 of /lib/moodlelib.php: call to debugging()
line 7619 of /lib/moodlelib.php: call to core_string_manager->get_string()
line 43 of /mod/attendance/settings.php: call to get_string()
line 3368 of /lib/pluginlib.php: call to include()
line 17 of /admin/settings/plugins.php: call to plugininfo_mod->load_settings()
line 6416 of /lib/adminlib.php: call to require()
line 177 of /admin/blocks.php: call to admin_get_root()

Invalid get_string() identifier: 'resultsperpage_desc' or component 'attendance'. Perhaps you are missing $string['resultsperpage_desc'] = ''; in mod/attendance/lang/en/attendance.php?

line 6927 of /lib/moodlelib.php: call to debugging()
line 7619 of /lib/moodlelib.php: call to core_string_manager->get_string()
line 43 of /mod/attendance/settings.php: call to get_string()
line 3368 of /lib/pluginlib.php: call to include()
line 17 of /admin/settings/plugins.php: call to plugininfo_mod->load_settings()
line 6416 of /lib/adminlib.php: call to require()
line 177 of /admin/blocks.php: call to admin_get_root()

Error when submitting attendance form (by teacher)

Hello,

In debug mode, this error is displaying when submitting attendance form (by teacher) :

Argument $record must be an instance of stdClass.

line 784 of /lib/classes/event/base.php: call to debugging()
line 970 of /mod/attendance/locallib.php: call to core\event\base->add_record_snapshot()
line 56 of /mod/attendance/take.php: call to attendance->take_from_form_data()

However, it seems to work ...

*Dan Marsden said :

Thanks Pascal - probably a bit of a restructure of the attendance class needed in attendance/locallib.php to remove that warning - feel free to add an issue in github here*

Missing language pack strings in block

Version 2013070302

Invalid get_string() identifier: 'attendance:addinstance' or component 'block_attendance'. Perhaps you are missing $string['attendance:addinstance'] = ''; in /var/www/beta/blocks/attendance/lang/en/block_attendance.php? line 293 of /lib/classes/string_manager_standard.php: call to debugging() line 6856 of /lib/moodlelib.php: call to core_string_manager_standard->get_string() line 2962 of /lib/accesslib.php: call to get_string() line 2820 of /lib/accesslib.php: call to get_capability_string() line 113 of /admin/roles/classes/capability_table_base.php: call to get_capability_docs_link() line 139 of /admin/roles/classes/capability_table_with_risks.php: call to core_role_capability_table_base->display() line 624 of /admin/roles/classes/define_role_table_advanced.php: call to core_role_capability_table_with_risks->display() line 267 of /admin/roles/define.php: call to core_role_define_role_table_advanced->display()

invalid use of params/arrays.

Invalid array parameter detected in required_param(): sessid

line 536 of /lib/moodlelib.php: call to debugging()
line 119 of /mod/attendance/sessions.php: call to required_param()

Sessions with taken attendance show twice in student report

After taking attendance for a session, that session will appear twice in a student's attendance report.

Steps to reproduce:

  1. Create an Attendance activity with multiple sessions.
  2. Take attendance on one of the sessions.
  3. Click the Reports tab, then an individual's name to view the report for that student.
  4. Note that the attendance which was taken will show up twice (incorrectly), whereas attendances that have not been taken yet only show up once (correctly).

This was discussed in the forums and it was mentioned that the problem is with PHP's array_merge() treating numeric keys differently than text keys. A suggested fix is also in the discussion. I tested that the suggested fix does resolve the problem but we're unsure if this is the fix the maintainer wants to implement. https://moodle.org/mod/forum/discuss.php?d=229257

Fatal error on install

I get a stack trace when attempting a fresh installation in 2.4.5:

The number of objects with previous not set is different from 1
• line 291 of /lib/xmldb/xmldb_object.php: call to debugging()
• line 553 of /lib/xmldb/xmldb_table.php: call to xmldb_object->checkPreviousNextValues()
• line 259 of /lib/xmldb/xmldb_structure.php: call to xmldb_table->arr2xmldb_table()
• line 172 of /lib/xmldb/xmldb_file.php: call to xmldb_structure->arr2xmldb_structure()
• line 153 of /lib/xmldb/xmldb_file.php: call to xmldb_file->arr2xmldb_structure()
• line 344 of /lib/ddl/database_manager.php: call to xmldb_file->loadXMLStructure()
• line 365 of /lib/ddl/database_manager.php: call to database_manager->load_xmldb_file()
• line 596 of /lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
• line 360 of /lib/upgradelib.php: call to upgrade_plugins_modules()
• line 1544 of /lib/upgradelib.php: call to upgrade_plugins()
• line 349 of /admin/index.php: call to upgrade_noncore()
Some FIELDS previous/next values are incorrect
• line 2113 of /lib/datalib.php: call to debugging()
• line 469 of /lib/xmldb/xmldb_object.php: call to xmldb_debug()
• line 555 of /lib/xmldb/xmldb_table.php: call to xmldb_object->debug()
• line 259 of /lib/xmldb/xmldb_structure.php: call to xmldb_table->arr2xmldb_table()
• line 172 of /lib/xmldb/xmldb_file.php: call to xmldb_structure->arr2xmldb_structure()
• line 153 of /lib/xmldb/xmldb_file.php: call to xmldb_file->arr2xmldb_structure()
• line 344 of /lib/ddl/database_manager.php: call to xmldb_file->loadXMLStructure()
• line 365 of /lib/ddl/database_manager.php: call to database_manager->load_xmldb_file()
• line 596 of /lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
• line 360 of /lib/upgradelib.php: call to upgrade_plugins_modules()
• line 1544 of /lib/upgradelib.php: call to upgrade_plugins()
• line 349 of /admin/index.php: call to upgrade_noncore()
Problem loading table attendance
• line 2113 of /lib/datalib.php: call to debugging()
• line 469 of /lib/xmldb/xmldb_object.php: call to xmldb_debug()
• line 263 of /lib/xmldb/xmldb_structure.php: call to xmldb_object->debug()
• line 172 of /lib/xmldb/xmldb_file.php: call to xmldb_structure->arr2xmldb_structure()
• line 153 of /lib/xmldb/xmldb_file.php: call to xmldb_file->arr2xmldb_structure()
• line 344 of /lib/ddl/database_manager.php: call to xmldb_file->loadXMLStructure()
• line 365 of /lib/ddl/database_manager.php: call to database_manager->load_xmldb_file()
• line 596 of /lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
• line 360 of /lib/upgradelib.php: call to upgrade_plugins_modules()
• line 1544 of /lib/upgradelib.php: call to upgrade_plugins()
• line 349 of /admin/index.php: call to upgrade_noncore()
XML database file errors found
More information about this error
Debug info: Errors found in XMLDB file: Problem loading table attendance, Some FIELDS previous/next values are incorrect
Error code: ddlxmlfileerror
Stack trace:
• line 349 of /lib/ddl/database_manager.php: ddl_exception thrown
• line 365 of /lib/ddl/database_manager.php: call to database_manager->load_xmldb_file()
• line 596 of /lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
• line 360 of /lib/upgradelib.php: call to upgrade_plugins_modules()
• line 1544 of /lib/upgradelib.php: call to upgrade_plugins()
• line 349 of /admin/index.php: call to upgrade_noncore()

Session stats is not initialised

The $sessionstats array in render_attendance_take_data() isn't initliased properly and throws undefined offset notices.

Main problem is that the individual counters are "lazily" initialised through the first access:
$sessionstats[$status->id]++;
which creates a key, defaults it to 0 and then increments it.

It would be better (and not thow notices) as:

if (!isset($sessionstats[$status->id])) {
   $sessionstats[$status->id] =0;
}
$sessionstats[$status->id]++;

Fatal error

In mod/attendance/backup/moodle2/backup_attendance_activity_task.class.php , line 28, there's a require_once call to a file (backup_attendance_settingslib.php) that doesn't exist. So if this mod is enabled and someone tries to backup / import, etc. The page will bork.

Viewing Attendances with Parent Role not working

When I logon as a parent any place I select to view the attendance I get the following error.

Sorry, but you do not currently have permissions to do that (Viewing Attendances)

I have checked the role permissions and I haven given my parent role allow permission for Viewing Attendances.

Student, Teacher, Administrator access to student attendance works as it should.

Is there something I'm overlooking?

"Display all" option

Currently the take.php page displays the options on a paged basis.

We have staff who use this page to print attendance lists (i.e. for noting on manually and then transcribing).

It would be helpful if there was a Display all option for the page that would put all of the users on a single page for printing.

attendance event trigger record_snapshot requires stdclass

new events require stdclass to be passed in record_snapshot:

Argument $record must be an instance of stdClass.
line 784 of /lib/classes/event/base.php: call to debugging()
line 70 of /mod/attendance/report.php: call to core\event\base->add_record_snapshot()

Argument $record must be an instance of stdClass.
line 784 of /lib/classes/event/base.php: call to debugging()
line 904 of /mod/attendance/locallib.php: call to core\event\base->add_record_snapshot()
line 56 of /mod/attendance/take.php: call to attendance->take_from_form_data()

probably all event trigers have this issue in attendance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.