## General developer forum

Okay, I think I am following the documentation on:

But every time I upgrade my block the server->schedule_task doesn't show my block.

<?php

{

public function get_name()      {

return "Record and Reset Course (AutoTeach)";

}

public function execute()         {

set_config('Reset_Chron','1','autoteach');

}

}

?>

<?php

'blocking'=>"0",

'minute'=>"*",

'hour'=>"*",

'day'=>"*",

'dayofweek'=>"*",

'month' =>"*",

'disable'=>'0'

));?>

I do not understand what I am missing do I need to make a function has_tasks()? (Like I did for settings?)  Any help would be appreciated.

I have also made sure the web-server owns the files, and I tried making both files executable as well.  It has to be something silly I am missing.

Thanks,
BAT

Average of ratings: -

I think the Moodle autoclass loading is not picking up your class. In the classes folder your file needs to be in a subfolder called task I believe.

Average of ratings: -

Sorry typo, I have the folder called task.

Average of ratings: -

Hi,

If your code above is exactly your code, you have a typo in it.

class record_transcripts extends \core\task\schedule_task

The correct code part:

class record_transcripts extends \core\task\scheduled_task

Maybe that's why the class is not loaded.

Best regards
Andreas

Average of ratings: -

Wow, I missed that.  Thank you.  I am still having problems getting it to load.   IS there a specific naming convention I need for the file inside the folder?

I know it is using my blocks namespace inside php.

I have it named as record_transcripts.php right now. does it need to be autoteach_record_transcripts... or something like that?

Thanks again for the syntax check!

BAT

Average of ratings: -

I don't know what you are missing . The code seems ok to me.

I would check the following things (and please don't use the closing php tags "?>" in your code!):

<?php// This is a testfile to check whether an existing class is loaded.require_once('config.php');if (class_exists('block_autoteach\task\record_transcripts')) {    echo 'ok';}

Best regards
Andreas

Average of ratings: -

It doesn't like the require_once('config.php') line.   It just gives me a white page if I have it.

It will not recognize the function either.

I am using Moodle 3.4.

Thanks,

BAT

Average of ratings: -

I have the same file name and the class name.

I, stupidly, forgot to set my crontab.  So now cron is actually running.  However, I am still not loading my task.

~BAT

Average of ratings: -

What file should this go under?

Thanks,
BAT

Average of ratings: -

Wow, I missed that.  Thank you.  I am still having problems getting it to load.   IS there a specific naming convention I need for the file inside the folder?

I know it is using my blocks namespace inside php.

I have it named as record_transcripts.php right now. does it need to be autoteach_record_transcripts... or something like that?

Thanks again for the syntax check!

BAT

Average of ratings: -