-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
4.1.1
-
None
-
MOODLE_401_STABLE
Hi,
In a calculated question type I need to manage units like these:
Unit: W Multiplier: 1
Unit: kW Multiplier: 0.001
Unit: MW Multiplier: 1.0E-6
Unit: mW Multiplier: 1000
but I get this error:
-------------------------------------------------------------
Informazioni di debug: Duplicate entry '1491-mW' for key 'mdl_question_numerical_units.mdl_quesnumeunit_queuni_uix'
INSERT INTO mdl_question_numerical_units (question,multiplier,unit) VALUES(?,?,?)
[array (
0 => 1491,
1 => 1000,
2 => 'mW',
)]
Error code: dmlwriteexception
Stack trace:
line 497 of /lib/dml/moodle_database.php: dml_write_exception thrown
line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
line 1362 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end()
line 1408 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
line 356 of /question/type/numerical/questiontype.php: call to mysqli_native_moodle_database->insert_record()
line 63 of /question/type/calculatedsimple/questiontype.php: call to qtype_numerical->save_units()
line 538 of /question/type/questiontypebase.php: call to qtype_calculatedsimple->save_question_options()
line 616 of /question/type/calculated/questiontype.php: call to question_type->save_question()
line 294 of /question/bank/editquestion/question.php: call to qtype_calculated->save_question()
-------------------------------------------------------------
If I exclude the last unit
Unit: mW Multiplier: 1000
it works just fine.
Regards
Francesco
- duplicates
-
MDL-22117 Units in numerical questions are acting case sensitive, but not functioning that way.
-
- Reopened
-