MDL-70374 qtype_multichoice: improve alignment of choices
[moodle.git] / question / classes / statistics / questions / calculated_for_subquestion.php
CommitLineData
515b3ae6
JP
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 * Class for storing calculated sub question statistics and intermediate calculation values.
19 *
20 * @package core_question
21 * @copyright 2013 The Open University
22 * @author James Pratt me@jamiep.org
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24 */
25
26namespace core_question\statistics\questions;
27defined('MOODLE_INTERNAL') || die();
28
fcdd04db
JP
29/**
30 * A class to store calculated stats for a sub question.
31 *
32 * @package core_question
33 * @copyright 2013 The Open University
34 * @author James Pratt me@jamiep.org
35 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
36 */
515b3ae6
JP
37class calculated_for_subquestion extends calculated {
38 public $subquestion = true;
39
fcdd04db
JP
40 /**
41 * @var array What slots is this sub question used in?
42 */
515b3ae6
JP
43 public $usedin = array();
44
fcdd04db
JP
45 /**
46 * @var bool Have the slots this sub question has been used in got different grades?
47 */
515b3ae6
JP
48 public $differentweights = false;
49
50 public $negcovar = 0;
1239d287
JP
51
52 /**
53 * @var int only set immediately before display in the table. The order of display in the table.
54 */
55 public $subqdisplayorder;
c3e2e754
JP
56
57 /**
fcdd04db
JP
58 * Constructor.
59 *
c3e2e754
JP
60 * @param object|null $step the step data for the step that this sub-question was first encountered in.
61 * @param int|null $variant the variant no
62 */
63 public function __construct($step = null, $variant = null) {
64 if ($step !== null) {
65 $this->questionid = $step->questionid;
66 $this->maxmark = $step->maxmark;
67 }
68 $this->variant = $variant;
c3e2e754 69 }
515b3ae6 70}