Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 36... Línea 36...
36
 * @package    core_question
36
 * @package    core_question
37
 * @category   test
37
 * @category   test
38
 * @copyright  2009 The Open University
38
 * @copyright  2009 The Open University
39
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
39
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
40
 */
40
 */
41
class questionattempt_with_steps_test extends \advanced_testcase {
41
final class questionattempt_with_steps_test extends \advanced_testcase {
42
    private $question;
42
    private $question;
43
    private $qa;
43
    private $qa;
Línea 44... Línea 44...
44
 
44
 
-
 
45
    protected function setUp(): void {
45
    protected function setUp(): void {
46
        parent::setUp();
46
        $this->question = \test_question_maker::make_question('description');
47
        $this->question = \test_question_maker::make_question('description');
47
        $this->qa = new testable_question_attempt($this->question, 0, null, 2);
48
        $this->qa = new testable_question_attempt($this->question, 0, null, 2);
48
        for ($i = 0; $i < 3; $i++) {
49
        for ($i = 0; $i < 3; $i++) {
49
            $step = new question_attempt_step(array('i' => $i));
50
            $step = new question_attempt_step(array('i' => $i));
50
            $this->qa->add_step($step);
51
            $this->qa->add_step($step);
51
        }
52
        }
Línea 52... Línea 53...
52
    }
53
    }
53
 
54
 
-
 
55
    protected function tearDown(): void {
54
    protected function tearDown(): void {
56
        $this->qa = null;
Línea 55... Línea 57...
55
        $this->qa = null;
57
        parent::tearDown();
56
    }
58
    }
57
 
59
 
Línea 167... Línea 169...
167
    /**
169
    /**
168
     * Test cases for {@see test_validate_manual_mark()}.
170
     * Test cases for {@see test_validate_manual_mark()}.
169
     *
171
     *
170
     * @return array test cases
172
     * @return array test cases
171
     */
173
     */
172
    public function validate_manual_mark_cases(): array {
174
    public static function validate_manual_mark_cases(): array {
173
        // Recall, the DB schema stores question grade information to 7 decimal places.
175
        // Recall, the DB schema stores question grade information to 7 decimal places.
174
        return [
176
        return [
175
            [0, 1, 2, null, ''],
177
            [0, 1, 2, null, ''],
176
            [0, 1, 2, '', ''],
178
            [0, 1, 2, '', ''],
177
            [0, 1, 2, '0', ''],
179
            [0, 1, 2, '0', ''],