WeBWorK Main Forum

LTI mass update scheduling

LTI mass update scheduling

by Sarunas Burdulis -
Number of replies: 4

Hi,

Can anyone explain, how LTI mass update is triggered? (I know how to set the interval).

Would it be possible to do mass_update() at predetermined time(s)?

Thanks!

In reply to Sarunas Burdulis

Re: LTI mass update scheduling

by Danny Glin -
mass_update is triggered from ContentGenerator.pm. Every time a page is loaded in WeBWorK, the function is executed. The function then checks if sufficient time has passed since the last update, and if so, it updates the grades.

Even if you set the interval to 24h, there are no guarantees that it will run exactly 24h later. If no one loads a page in WeBWorK (e.g. in the middle of the night), then it won't run until the next page load.

Setting it to run at a specific time would involve some changes to the code, as the interval check is built into mass_update(). You could create a new function without that check, and then theoretically run it from a cron job.
In reply to Danny Glin

Re: LTI mass update scheduling

by Sarunas Burdulis -

Thank, Danny,

I think I could write a function, but what interface should one use to invoke such a function?



In reply to Sarunas Burdulis

Re: LTI mass update scheduling

by Danny Glin -

I must admin I've never actually done this.  Take a look at the scripts in /opt/webwork/webwork2/bin.  Many of them execute WeBWorK operations from the command line.  It's likely that this can be done with wwsh, which is designed for exactly this sort of thing.

For more detail someone with more experience with these things will have to chime in.

In reply to Danny Glin

Re: LTI mass update scheduling

by Sarunas Burdulis -

It would be tempting to call mass_update() from a script fed to wwsh. However it looks like an HTTP request from LMS to WeBWorK is first needed in order to construct a pass-back HTTP POST to LMS...

That is probably the reason mass_update() is called from ContentGenerator :)