-
Bug
-
Resolution: Fixed
-
Major
-
2.8.1
-
MOODLE_28_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
Easy
-
With our ID randomiser, it easily goes out of range when using a scale because the scale id does not match the pression of the grade scales - this can be demonstrated (consistently for me) with the following behat scenario:
https://github.com/danpoltawski/moodle/compare/8f06fff...MDL-48631-master
Scenario: Bugs are us
|
Given the following "courses" exist:
|
| fullname | shortname | category |
|
| Course 1 | C1 | 0 |
|
And I log in as "admin"
|
And I follow "Course 1"
|
And I turn editing mode on
|
And I add a "Lesson" to section "1" and I fill the form with:
|
| Name | Test lesson name |
|
| Description | Lesson description |
|
| Type | Scale |
|
Expected result - succeeds.
Actual result:
01. Moodle exception: Error writing to database More information about this error
|
|
Debug info:
|
ERROR: value "-139000" is out of range for type smallint
|
INSERT INTO zbehat_lesson (width,height,bgcolor,mediawidth,mediaheight,mediaclose,maxhighscores,name,progressbar,ongoing,displayleft,displayleftif,slideshow,maxanswers,feedback,available,deadline,maxtime,usepassword,dependency,modattempts,review,maxattempts,nextpagedefault,maxpages,grade,practice,custom,retake,usemaxgrade,minquestions,course,intro,introformat,timemodified,timed,conditions) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37) RETURNING id
|
[array (
|
'width' => 640,
|
'height' => 480,
|
'bgcolor' => '#FFFFFF',
|
'mediawidth' => 640,
|
'mediaheight' => 480,
|
'mediaclose' => 0,
|
'maxhighscores' => 10,
|
'name' => 'Test lesson name',
|
'progressbar' => '0',
|
'ongoing' => '0',
|
'displayleft' => '0',
|
'displayleftif' => '0',
|
'slideshow' => '0',
|
'maxanswers' => '4',
|
'feedback' => '0',
|
'available' => 0,
|
'deadline' => 0,
|
'maxtime' => 20,
|
'usepassword' => '0',
|
'dependency' => '0',
|
'modattempts' => '0',
|
'review' => '0',
|
'maxattempts' => '1',
|
'nextpagedefault' => '0',
|
'maxpages' => '0',
|
'grade' => -139000,
|
'practice' => '0',
|
'custom' => '1',
|
'retake' => '0',
|
'usemaxgrade' => '0',
|
'minquestions' => '0',
|
'course' => '105000',
|
'intro' => 'Lesson description',
|
'introformat' => '1',
|
'timemodified' => 1418824795,
|
'timed' => 0,
|
'conditions' => 'O:8:"stdClass":3:{s:9:"timespent";i:0;s:9:"completed";i:0;s:15:"gradebetterthan";i:0;}',
|
)]
|
Error code: dmlwriteexception
|
|
Stack trace:
|
|
line 446 of /lib/dml/moodle_database.php: dml_write_exception thrown
|
line 244 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
|
line 868 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
|
line 924 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
|
line 51 of /mod/lesson/lib.php: call to pgsql_native_moodle_database->insert_record()
|
line 121 of /course/modlib.php: call to lesson_add_instance()
|
line 266 of /course/modedit.php: call to add_moduleinfo()
|
In step `Given I press "Save and return to course"'. # behat_forms::press_button()
|
From scenario `Bugs are us'. # /Users/danp/moodles/pm/moodle/mod/lesson/tests/behat/demonstrate_scale_precession.feature:8
|
Of feature `Incorrect grade scale precission in lesson'. #
|