Skip to content

Commit 8d1b8f8

Browse files
committed
Update to current OU live version
1 parent 55a3f76 commit 8d1b8f8

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

lib.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ function ouwiki_get_post_actions() {
875875
function ouwiki_get_coursemodule_info($coursemodule) {
876876
global $DB;
877877
$ouwiki = $DB->get_record('ouwiki',
878-
['id' => $coursemodule->instance], 'id, name, completionpages, completionedits');
878+
['id' => $coursemodule->instance], 'id, name, completionpages, completionedits, intro, introformat');
879879
if (!$ouwiki) {
880880
return null;
881881
}
@@ -889,6 +889,10 @@ function ouwiki_get_coursemodule_info($coursemodule) {
889889
$info->customdata->customcompletionrules['completionedits'] = $ouwiki->completionedits;
890890
}
891891

892+
if ($coursemodule->showdescription) {
893+
$info->content = format_module_intro('ouwiki', $ouwiki, $coursemodule->id, false);
894+
}
895+
892896
return $info;
893897
}
894898

locallib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4058,7 +4058,7 @@ function ouwiki_get_completion_state_lib($cm, $userid, $type) {
40584058
if ($ouwiki->completionpages) {
40594059
$value = $ouwiki->completionpages <=
40604060
$DB->get_field_sql($countsql .
4061-
' AND (SELECT MIN (id)
4061+
' AND (SELECT MIN(id)
40624062
FROM {ouwiki_versions}
40634063
WHERE pageid = p.id AND deletedat IS NULL) = v.id',
40644064
[$userid, $ouwiki->id]);

tests/behat/basic.feature

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,3 +779,24 @@ Feature: Test Post and Comment on OUwiki entry
779779
And I press "Save changes"
780780
When I am on "Course 2" course homepage
781781
Then I should see "100%"
782+
783+
Scenario: Check description on course page
784+
Given the following "activity" exists:
785+
| activity | ouwiki |
786+
| course | C1 |
787+
| name | W.WC |
788+
| intro | Test wiki desc show |
789+
| showdescription | 1 |
790+
| groupmode | 0 |
791+
| section | 1 |
792+
And the following "activity" exists:
793+
| activity | ouwiki |
794+
| course | C1 |
795+
| name | W.WC2 |
796+
| intro | Test wiki no show |
797+
| showdescription | 0 |
798+
| groupmode | 0 |
799+
| section | 1 |
800+
When I am on the "Course 1" "course" page logged in as "teacher1"
801+
Then I should see "Test wiki desc show"
802+
And I should not see "Test wiki no show"

0 commit comments

Comments
 (0)