MDL-29627 quiz access: fix variable names that don't match the coding style.
[moodle.git] / mod / quiz / accessrule / safebrowser / rule.php
CommitLineData
a28a5d74
TH
1<?php
2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
17/**
18 * Implementaton of the quizaccess_safebrowser plugin.
19 *
20 * @package quizaccess
21 * @subpackage safebrowser
22 * @copyright 2011 The Open University
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24 */
25
26
27defined('MOODLE_INTERNAL') || die();
28
29require_once($CFG->dirroot . '/mod/quiz/accessrule/accessrulebase.php');
30
31
32/**
33* A rule representing the safe browser check.
34*
35* @copyright 2009 Oliver Rahs
36* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
37*/
38class safebrowser_access_rule extends quiz_access_rule_base {
39 public function prevent_access() {
e5844040 40 if (!$this->quizobj->is_preview_user() && !quiz_check_safe_browser()) {
a28a5d74
TH
41 return get_string('safebrowsererror', 'quiz');
42 } else {
43 return false;
44 }
45 }
46
47 public function description() {
48 return get_string("safebrowsernotice", "quiz");
49 }
50}