Skip to content

Commit

Permalink
Update to current OU live version
Browse files Browse the repository at this point in the history
  • Loading branch information
sammarshallou committed Dec 7, 2023
1 parent 55a3f76 commit 8d1b8f8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ function ouwiki_get_post_actions() {
function ouwiki_get_coursemodule_info($coursemodule) {
global $DB;
$ouwiki = $DB->get_record('ouwiki',
['id' => $coursemodule->instance], 'id, name, completionpages, completionedits');
['id' => $coursemodule->instance], 'id, name, completionpages, completionedits, intro, introformat');
if (!$ouwiki) {
return null;
}
Expand All @@ -889,6 +889,10 @@ function ouwiki_get_coursemodule_info($coursemodule) {
$info->customdata->customcompletionrules['completionedits'] = $ouwiki->completionedits;
}

if ($coursemodule->showdescription) {
$info->content = format_module_intro('ouwiki', $ouwiki, $coursemodule->id, false);
}

return $info;
}

Expand Down
2 changes: 1 addition & 1 deletion locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -4058,7 +4058,7 @@ function ouwiki_get_completion_state_lib($cm, $userid, $type) {
if ($ouwiki->completionpages) {
$value = $ouwiki->completionpages <=
$DB->get_field_sql($countsql .
' AND (SELECT MIN (id)
' AND (SELECT MIN(id)
FROM {ouwiki_versions}
WHERE pageid = p.id AND deletedat IS NULL) = v.id',
[$userid, $ouwiki->id]);
Expand Down
21 changes: 21 additions & 0 deletions tests/behat/basic.feature
Original file line number Diff line number Diff line change
Expand Up @@ -779,3 +779,24 @@ Feature: Test Post and Comment on OUwiki entry
And I press "Save changes"
When I am on "Course 2" course homepage
Then I should see "100%"

Scenario: Check description on course page
Given the following "activity" exists:
| activity | ouwiki |
| course | C1 |
| name | W.WC |
| intro | Test wiki desc show |
| showdescription | 1 |
| groupmode | 0 |
| section | 1 |
And the following "activity" exists:
| activity | ouwiki |
| course | C1 |
| name | W.WC2 |
| intro | Test wiki no show |
| showdescription | 0 |
| groupmode | 0 |
| section | 1 |
When I am on the "Course 1" "course" page logged in as "teacher1"
Then I should see "Test wiki desc show"
And I should not see "Test wiki no show"

0 comments on commit 8d1b8f8

Please sign in to comment.