GithubHelp home page GithubHelp logo

grade_notify's People

Contributors

philcali avatar rrusso avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grade_notify's Issues

cron interval help is misleading

the admin setting for cron interval has some descriptive text that I think is misleading:
Override (in hours) what a cron interval should be. Hint: zero will force every run.

The problem with this is that this value is used to determined not only when the thing runs, but also which grade items qualify for notification based on the timemodified value, creating a condition where no grade items will be selected, ie timemodified > now() AND timemodified < now()

//block_grade_notify.php:51
        $now = time();

        $runready = ($now - $lastcron) >= ($interval * 60 * 60);

        if (!$runready) {
            return false;
        }



//lib.php:92
$interval = (int)get_config('block_grade_notify', 'croninterval');
        $from = $now - ($interval * 60 * 60);


//lib.php:117
        $sql = "SELECT gg.id, gg.userid, gi.courseid, gi.itemname
                    FROM {grade_items} gi,
                         {grade_grades} gg
                    WHERE gg.userid = :userid
                    AND gi.courseid = :courseid
                    AND gg.itemid = gi.id
                    AND gi.hidden = 0
                    AND gg.hidden = 0
                    AND (gi.itemtype = 'manual' OR gi.itemtype = 'mod')
                    AND (gg.timemodified > :from AND gg.timemodified < :now)";

        $params = array(
            'userid' => $userid,
            'courseid' => $course->id,
            'now' => $now,
            'from' => $from
        );


Testing

The grade notifications block is ready for testing. Notable changes from 1.9:

  • The select page is now a Moodleform
  • removed jquery dependency (YUI now manips the DOM)
  • gave users ability to auto-apply notifications on future enrolled courses
  • db cleanup through events
  • notifications materialize in the form of notification message (popup, email, whatever else configured); straight email is now a backup method
  • better notification message

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.