Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
16c7457f
Commit
16c7457f
authored
Oct 17, 2012
by
Tim Hunt
Browse files
MDL-36076 qtype multichoice: validation fails on '0' answer.
parent
ecfe814e
Changes
1
Hide whitespace changes
Inline
Side-by-side
question/type/multichoice/edit_multichoice_form.php
View file @
16c7457f
...
...
@@ -110,10 +110,10 @@ class qtype_multichoice_edit_form extends question_edit_form {
//check no of choices
$trimmedanswer
=
trim
(
$answer
[
'text'
]);
$fraction
=
(
float
)
$data
[
'fraction'
][
$key
];
if
(
empty
(
$trimmedanswer
)
&&
empty
(
$fraction
))
{
if
(
$trimmedanswer
===
''
&&
empty
(
$fraction
))
{
continue
;
}
if
(
empty
(
$trimmedanswer
)
)
{
if
(
$trimmedanswer
===
''
)
{
$errors
[
'fraction['
.
$key
.
']'
]
=
get_string
(
'errgradesetanswerblank'
,
'qtype_multichoice'
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment