Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 68... Línea 68...
68
 * @copyright  2009 The Open University
68
 * @copyright  2009 The Open University
69
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
69
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
70
 */
70
 */
71
class question_attempt_step {
71
class question_attempt_step {
72
    /**
72
    /**
-
 
73
     * @var int Indicates that timecreated will be set the first time the attempt is rendered
-
 
74
     */
-
 
75
    const TIMECREATED_ON_FIRST_RENDER = -1;
-
 
76
 
-
 
77
    /**
73
     * @var integer if this attempts is stored in the question_attempts table,
78
     * @var integer if this attempts is stored in the question_attempts table,
74
     * the id of that row.
79
     * the id of that row.
75
     */
80
     */
76
    private $id = null;
81
    private $id = null;
Línea 105... Línea 110...
105
    /**
110
    /**
106
     * You should not need to call this constructor in your own code. Steps are
111
     * You should not need to call this constructor in your own code. Steps are
107
     * normally created by {@see question_attempt} methods like
112
     * normally created by {@see question_attempt} methods like
108
     * {@see question_attempt::process_action()}.
113
     * {@see question_attempt::process_action()}.
109
     * @param array $data the submitted data that defines this step.
114
     * @param array $data the submitted data that defines this step.
110
     * @param int|null $timecreated the time to record for the action. (If not given, use now.)
115
     * @param int|null $timecreated the time to record for the action. If null, use now. If
-
 
116
     *     {@see self::TIMECREATED_ON_FIRST_RENDER}, the time will be set the first time the attempt is rendered.
111
     * @param int|null $userid the user to attribute the aciton to. (If not given, use the current user.)
117
     * @param int|null $userid the user to attribute the aciton to. (If not given, use the current user.)
112
     * @param int|null $existingstepid if this step is going to replace an existing step
118
     * @param int|null $existingstepid if this step is going to replace an existing step
113
     *      (for example, during a regrade) this is the id of the previous step we are replacing.
119
     *      (for example, during a regrade) this is the id of the previous step we are replacing.
114
     */
120
     */
115
    public function __construct($data = [], $timecreated = null, $userid = null,
121
    public function __construct($data = [], $timecreated = null, $userid = null,
Línea 219... Línea 225...
219
    public function get_timecreated() {
225
    public function get_timecreated() {
220
        return $this->timecreated;
226
        return $this->timecreated;
221
    }
227
    }
Línea 222... Línea 228...
222
 
228
 
-
 
229
    /**
-
 
230
     * Setter for $this->timecreated.
-
 
231
     *
-
 
232
     * @param int $timecreated
-
 
233
     * @return void
-
 
234
     */
-
 
235
    public function set_timecreated(int $timecreated): void {
-
 
236
        $this->timecreated = $timecreated;
-
 
237
    }
-
 
238
 
223
    /**
239
    /**
224
     * @param string $name the name of a question type variable to look for in the submitted data.
240
     * @param string $name the name of a question type variable to look for in the submitted data.
225
     * @return bool whether a variable with this name exists in the question type data.
241
     * @return bool whether a variable with this name exists in the question type data.
226
     */
242
     */
227
    public function has_qt_var($name) {
243
    public function has_qt_var($name) {