@@ -276,7 +276,7 @@ function standard_grading_coursemodule_elements() {
276276 * Adds all the standard elements to a form to edit the settings for an activity module for Hsuforum.
277277 */
278278 protected function standard_hsuforum_coursemodule_elements () {
279- global $ COURSE , $ CFG , $ DB ;
279+ global $ COURSE , $ CFG , $ DB , $ OUTPUT ;
280280 $ mform =& $ this ->_form ;
281281
282282 if (!empty ($ CFG ->core_outcome_enable )) {
@@ -370,6 +370,13 @@ protected function standard_hsuforum_coursemodule_elements() {
370370 // So it uses a long name that will not conflict.
371371 $ mform ->addElement ('textarea ' , 'availabilityconditionsjson ' ,
372372 get_string ('accessrestrictions ' , 'availability ' ));
373+ // Availability loading indicator.
374+ $ loadingcontainer = $ OUTPUT ->container (
375+ $ OUTPUT ->render_from_template ('core/loading ' , []),
376+ 'd-flex justify-content-center py-5 icon-size-5 ' ,
377+ 'availabilityconditions-loading '
378+ );
379+ $ mform ->addElement ('html ' , $ loadingcontainer );
373380 // The _cm variable may not be a proper cm_info, so get one from modinfo.
374381 if ($ this ->_cm ) {
375382 $ modinfo = get_fast_modinfo ($ COURSE );
@@ -395,7 +402,7 @@ protected function standard_hsuforum_coursemodule_elements() {
395402
396403 $ trackingdefault = COMPLETION_TRACKING_NONE ;
397404 // If system and activity default is on, set it.
398- if ($ CFG ->completiondefault && $ this ->_features ->defaultcompletion ) {
405+ if (! empty ( $ CFG ->completiondefault ) && $ this ->_features ->defaultcompletion ) {
399406 $ hasrules = plugin_supports ('mod ' , $ this ->_modname , FEATURE_COMPLETION_HAS_RULES , true );
400407 $ tracksviews = plugin_supports ('mod ' , $ this ->_modname , FEATURE_COMPLETION_TRACKS_VIEWS , true );
401408 if ($ hasrules || $ tracksviews ) {
@@ -414,7 +421,7 @@ protected function standard_hsuforum_coursemodule_elements() {
414421 // Automatic completion once you view it
415422 $ gotcompletionoptions = false ;
416423 if (plugin_supports ('mod ' , $ this ->_modname , FEATURE_COMPLETION_TRACKS_VIEWS , false )) {
417- $ mform ->addElement ('checkbox ' , 'completionview ' , get_string ( ' completionview ' , ' completion ' ) ,
424+ $ mform ->addElement ('checkbox ' , 'completionview ' , '' ,
418425 get_string ('completionview_desc ' , 'completion ' ));
419426 $ mform ->hideIf ('completionview ' , 'completion ' , 'ne ' , COMPLETION_TRACKING_AUTOMATIC );
420427 // Check by default if automatic completion tracking is set.
@@ -437,11 +444,10 @@ protected function standard_hsuforum_coursemodule_elements() {
437444 $ mform ->addElement (
438445 'checkbox ' ,
439446 'completionusegrade ' ,
440- get_string ( ' completionusegrade ' , ' completion ' ) ,
447+ '' ,
441448 get_string ('completionusegrade_desc ' , 'completion ' )
442449 );
443450 $ mform ->hideIf ('completionusegrade ' , 'completion ' , 'ne ' , COMPLETION_TRACKING_AUTOMATIC );
444- $ mform ->addHelpButton ('completionusegrade ' , 'completionusegrade ' , 'completion ' );
445451
446452 // The disabledIf logic differs between ratings and other grade items due to different field types.
447453 if ($ this ->_features ->rating ) {
@@ -675,11 +681,11 @@ protected function add_hsuforum_rating_settings() {
675681 $ mform ->addElement ('checkbox ' , 'ratingtime ' , get_string ('ratingtime ' , 'rating ' ));
676682 $ mform ->hideIf ('ratingtime ' , $ assessedfieldname , 'eq ' , 0 );
677683
678- $ mform ->addElement ('date_time_selector ' , 'assesstimestart ' , get_string ('from ' ));
684+ $ mform ->addElement ('date_time_selector ' , 'assesstimestart ' , get_string ('fromdate ' ));
679685 $ mform ->hideIf ('assesstimestart ' , $ assessedfieldname , 'eq ' , 0 );
680686 $ mform ->hideIf ('assesstimestart ' , 'ratingtime ' );
681687
682- $ mform ->addElement ('date_time_selector ' , 'assesstimefinish ' , get_string ('to ' ));
688+ $ mform ->addElement ('date_time_selector ' , 'assesstimefinish ' , get_string ('todate ' ));
683689 $ mform ->hideIf ('assesstimefinish ' , $ assessedfieldname , 'eq ' , 0 );
684690 $ mform ->hideIf ('assesstimefinish ' , 'ratingtime ' );
685691 }
0 commit comments