Skip to content
GitLab
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
8b9dfc2b
Commit
8b9dfc2b
authored
Jan 13, 2011
by
Tim Hunt
Browse files
MDL-20636 Fix editing of multichoice questions.
parent
ce5e4fb6
Changes
3
Hide whitespace changes
Inline
Side-by-side
question/type/edit_question_form.php
View file @
8b9dfc2b
...
...
@@ -486,8 +486,8 @@ abstract class question_edit_form extends moodleform {
foreach
(
array
(
'correctfeedback'
,
'partiallycorrectfeedback'
,
'incorrectfeedback'
)
as
$feedbackname
)
{
$draftid
=
file_get_submitted_draft_itemid
(
$feedbackname
);
$question
->
$feedback
name
=
array
();
$question
->
$feedback
name
[
'text'
]
=
file_prepare_draft_area
(
$feedback
=
array
();
$feedback
[
'text'
]
=
file_prepare_draft_area
(
$draftid
,
// draftid
$this
->
context
->
id
,
// context
'qtype_multichoice'
,
// component
...
...
@@ -497,8 +497,10 @@ abstract class question_edit_form extends moodleform {
$question
->
options
->
$feedbackname
// text
);
$feedbackformat
=
$feedbackname
.
'format'
;
$question
->
$feedbackname
[
'format'
]
=
$question
->
options
->
$feedbackformat
;
$question
->
$feedbackname
[
'itemid'
]
=
$draftid
;
$feedback
[
'format'
]
=
$question
->
options
->
$feedbackformat
;
$feedback
[
'itemid'
]
=
$draftid
;
$question
->
$feedbackname
=
$feedback
;
}
if
(
$withshownumcorrect
)
{
...
...
@@ -531,9 +533,14 @@ abstract class question_edit_form extends moodleform {
$question
->
hint
[
$key
][
'itemid'
]
=
$draftitemid
;
$question
->
hint
[
$key
][
'format'
]
=
$hint
->
hintformat
;
$key
++
;
}
// TODO $withclearwrong, $withshownumpartscorrect
if
(
$withclearwrong
)
{
$question
->
hintclearwrong
[]
=
$hint
->
clearwrong
;
}
if
(
$withshownumpartscorrect
)
{
$question
->
hintshownumcorrect
[]
=
$hint
->
shownumcorrect
;
}
}
return
$question
;
}
...
...
question/type/multichoice/edit_multichoice_form.php
View file @
8b9dfc2b
...
...
@@ -67,7 +67,7 @@ class question_edit_multichoice_form extends question_edit_form {
$question
=
parent
::
data_preprocessing
(
$question
);
$question
=
$this
->
data_preprocessing_answers
(
$question
,
true
);
$question
=
$this
->
data_preprocessing_combined_feedback
(
$question
,
true
);
$question
=
$this
->
data_preprocessing_hints
(
$question
);
$question
=
$this
->
data_preprocessing_hints
(
$question
,
true
,
true
);
if
(
!
empty
(
$question
->
options
))
{
$question
->
single
=
$question
->
options
->
single
;
...
...
question/type/multichoice/questiontype.php
View file @
8b9dfc2b
...
...
@@ -140,6 +140,8 @@ class qtype_multichoice extends question_type {
$DB
->
update_record
(
'question_multichoice'
,
$options
);
$this
->
save_hints
(
$question
,
true
);
/// Perform sanity checks on fractional grades
if
(
$options
->
single
)
{
if
(
$maxfraction
!=
1
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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