Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 8b805ced71fac1435481fb3e1ecfae7906f10eb3 1 parent 55ffbab
sam marshall sammarshallou authored stronk7 committed
5 mod/survey/view.php
@@ -55,6 +55,11 @@
55 55 print_error('invalidtmptid', 'survey');
56 56 }
57 57
  58 +// Update 'viewed' state if required by completion system
  59 +require_once($CFG->libdir . '/completionlib.php');
  60 +$completion = new completion_info($course);
  61 +$completion->set_module_viewed($cm);
  62 +
58 63 $showscales = ($template->name != 'ciqname');
59 64
60 65 $strsurvey = get_string("modulename", "survey");
2  mod/wiki/lib.php
@@ -246,8 +246,6 @@ function wiki_supports($feature) {
246 246 return true;
247 247 case FEATURE_COMPLETION_TRACKS_VIEWS:
248 248 return true;
249   - case FEATURE_COMPLETION_HAS_RULES:
250   - return true;
251 249 case FEATURE_GRADE_HAS_GRADE:
252 250 return false;
253 251 case FEATURE_GRADE_OUTCOMES:
5 mod/wiki/view.php
@@ -258,6 +258,11 @@
258 258
259 259 add_to_log($course->id, 'wiki', 'view', 'view.php?id=' . $cm->id, $wiki->id);
260 260
  261 +// Update 'viewed' state if required by completion system
  262 +require_once($CFG->libdir . '/completionlib.php');
  263 +$completion = new completion_info($course);
  264 +$completion->set_module_viewed($cm);
  265 +
261 266 if (($edit != - 1) and $PAGE->user_allowed_editing()) {
262 267 $USER->editing = $edit;
263 268 }

0 comments on commit 8b805ce

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