Skip to content
Browse files

MDL-27491 Add 'complete on view' support to wiki, survey

  • Loading branch information...
1 parent 3fdc622 commit 05b7cd7ae92c54bc6ccc0101504dd9f1f1f5f822 @sammarshallou sammarshallou committed
Showing with 10 additions and 2 deletions.
  1. +5 −0 mod/survey/view.php
  2. +0 −2 mod/wiki/lib.php
  3. +5 −0 mod/wiki/view.php
View
5 mod/survey/view.php
@@ -55,6 +55,11 @@
print_error('invalidtmptid', 'survey');
}
+// Update 'viewed' state if required by completion system
+require_once($CFG->libdir . '/completionlib.php');
+$completion = new completion_info($course);
+$completion->set_module_viewed($cm);
+
$showscales = ($template->name != 'ciqname');
$strsurvey = get_string("modulename", "survey");
View
2 mod/wiki/lib.php
@@ -246,8 +246,6 @@ function wiki_supports($feature) {
return true;
case FEATURE_COMPLETION_TRACKS_VIEWS:
return true;
- case FEATURE_COMPLETION_HAS_RULES:
- return true;
case FEATURE_GRADE_HAS_GRADE:
return false;
case FEATURE_GRADE_OUTCOMES:
View
5 mod/wiki/view.php
@@ -258,6 +258,11 @@
add_to_log($course->id, 'wiki', 'view', 'view.php?id=' . $cm->id, $wiki->id);
+// Update 'viewed' state if required by completion system
+require_once($CFG->libdir . '/completionlib.php');
+$completion = new completion_info($course);
+$completion->set_module_viewed($cm);
+
if (($edit != - 1) and $PAGE->user_allowed_editing()) {
$USER->editing = $edit;
}

0 comments on commit 05b7cd7

Please sign in to comment.
Something went wrong with that request. Please try again.