0

I'm using moodle and for all availability conditions plugins there is a function get_description

this function suppose to return string that is displayed on the course module description

it is suppose to return string when it is not available to student which is ok and another string which displayed when it is available which it didn't appear at all

I searched and tried to change the code of the core availability and course formats but I failed any help

Return strings of the function

2

I tried to change core availability info , and core course format and templates but nothing solved the problem, I don't even know where to look

vimuth
  • 5,064
  • 33
  • 79
  • 116

1 Answers1

0

The availability condition is not supposed to output anything when the conditions are met. The $not param is for when the condition has been inverted when it has been configured.

e.g. it is possible to configure an availability condition for:

  • User's first name is "Fred" OR
  • User's first name is NOT "Fred"

The text is still only displayed if the user doesn't meet the condition, but the content of that text output will be different in each case.

davosmith
  • 6,037
  • 2
  • 14
  • 23
  • Okay I got it wrong, thanks – Mohammad Farouk Mar 17 '23 at 22:46
  • Is there is a way to display some string to be rendered in the description div even if the conditions is met to let the student know when this module will be locked I'm trying using another plugin as a block which is depend on the availability condition plugin I need, but I didn't want to go to a dead end, is there is any hint to start with? – Mohammad Farouk Mar 17 '23 at 22:49
  • Or Is there an api function I can add to the availability plugin to to so? – Mohammad Farouk Mar 17 '23 at 22:54
  • To the best of my knowledge, there is nothing in availability conditions that get any chance to output something, unless the activity is unavailable - if the condition is met, nothing can be output. I suggest you add a description to the activity (set to display on the course page) and manually write "this activity will be hidden if ..." – davosmith Mar 18 '23 at 07:31