Skip to content

Commit

Permalink
ommit coruses fix issue 42
Browse files Browse the repository at this point in the history
  • Loading branch information
EsdrasCaleb committed Jun 13, 2024
1 parent 3a8998e commit 3412f10
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lang/en/subcourse.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
$string['settings:coursepageprintgrade_desc'] = 'Display grade from referenced course on course page.';
$string['settings:coursepageprintprogress'] = 'Progress on course page';
$string['settings:coursepageprintprogress_desc'] = 'Display progress from referenced course on course page.';
$string['settings:displayhiddencourses'] = 'Display Hidden Courses';
$string['settings:displayhiddencourses_desc'] = 'When selecting a subcourse from list hidden coruses will be displayed.';
$string['subcourse:addinstance'] = 'Add a new subcourse';
$string['subcourse:begraded'] = 'Receive grade from the referenced course';
$string['subcourse:fetchgrades'] = 'Fetch grades manually from the referenced course';
Expand Down
10 changes: 7 additions & 3 deletions mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,14 @@ public function definition() {

foreach ($mycourses as $mycourse) {
$courselabel = $catlist[$mycourse->category] . ' / ' . $mycourse->fullname.' ('.$mycourse->shortname.')';
$options[$mycourse->id] = $courselabel;
if (empty($mycourse->visible)) {
$hiddenlabel = ' '.get_string('hiddencourse', 'subcourse');
$options[$mycourse->id] .= $hiddenlabel;
if($config->displayhiddencourses || $mycourse->id == $currentrefcourseid){
$hiddenlabel = ' '.get_string('hiddencourse', 'subcourse');
$options[$mycourse->id] = $courselabel.$hiddenlabel;
}
}
else{
$options[$mycourse->id] = $courselabel;
}
}

Expand Down
6 changes: 6 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,11 @@
get_string('settings:coursepageprintgrade_desc', 'mod_subcourse'),
1
));
$settings->add(new admin_setting_configcheckbox(
'mod_subcourse/displayhiddencourses',
get_string('settings:displayhiddencourses', 'mod_subcourse'),
get_string('settings:displayhiddencourses_desc', 'mod_subcourse'),
1
));
}
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

$plugin->component = 'mod_subcourse';
$plugin->release = 2023103000;
$plugin->version = 2023103000;
$plugin->version = 2024061300;
$plugin->maturity = MATURITY_STABLE;
$plugin->requires = 2022112800; // Requires 4.1
$plugin->supported = [401, 401];

0 comments on commit 3412f10

Please sign in to comment.