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
41dcc2a5
Commit
41dcc2a5
authored
Nov 15, 2010
by
Dongsheng Cai
Browse files
MDL-25220 Question editors need to support subdirs
parent
785d2cf2
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
question/type/calculatedmulti/edit_calculatedmulti_form.php
View file @
41dcc2a5
...
...
@@ -179,7 +179,7 @@ class question_edit_calculatedmulti_form extends question_edit_form {
$default_values
[
'correctanswerformat['
.
$key
.
']'
]
=
$answer
->
correctanswerformat
;
$default_values
[
'feedback['
.
$key
.
']'
]
=
array
();
// prepare draftarea
$default_values
[
'feedback['
.
$key
.
']'
][
'text'
]
=
file_prepare_draft_area
(
$draftid
,
$this
->
context
->
id
,
'question'
,
'answerfeedback'
,
empty
(
$answer
->
id
)
?
null
:
(
int
)
$answer
->
id
,
null
,
$answer
->
feedback
);
$default_values
[
'feedback['
.
$key
.
']'
][
'text'
]
=
file_prepare_draft_area
(
$draftid
,
$this
->
context
->
id
,
'question'
,
'answerfeedback'
,
empty
(
$answer
->
id
)
?
null
:
(
int
)
$answer
->
id
,
$this
->
fileoptions
,
$answer
->
feedback
);
$default_values
[
'feedback['
.
$key
.
']'
][
'format'
]
=
$answer
->
feedbackformat
;
$default_values
[
'feedback['
.
$key
.
']'
][
'itemid'
]
=
$draftid
;
$key
++
;
...
...
question/type/edit_question_form.php
View file @
41dcc2a5
...
...
@@ -66,8 +66,8 @@ class question_edit_form extends moodleform {
$record
=
$DB
->
get_record
(
'question_categories'
,
array
(
'id'
=>
$question
->
category
),
'contextid'
);
$this
->
context
=
get_context_instance_by_id
(
$record
->
contextid
);
$this
->
editoroptions
=
array
(
'maxfiles'
=>
EDITOR_UNLIMITED_FILES
,
'context'
=>
$this
->
context
);
$this
->
fileoptions
=
array
(
'subdir'
=>
true
,
'maxfiles'
=>
-
1
,
'maxbytes'
=>
-
1
);
$this
->
editoroptions
=
array
(
'
subdirs'
=>
1
,
'
maxfiles'
=>
EDITOR_UNLIMITED_FILES
,
'context'
=>
$this
->
context
);
$this
->
fileoptions
=
array
(
'subdir
s
'
=>
1
,
'maxfiles'
=>
-
1
,
'maxbytes'
=>
-
1
);
$this
->
category
=
$category
;
$this
->
categorycontext
=
get_context_instance_by_id
(
$category
->
contextid
);
...
...
@@ -323,7 +323,7 @@ class question_edit_form extends moodleform {
}
else
{
$questiontext
=
''
;
}
$questiontext
=
file_prepare_draft_area
(
$draftid
,
$this
->
context
->
id
,
'question'
,
'questiontext'
,
empty
(
$question
->
id
)
?
null
:
(
int
)
$question
->
id
,
null
,
$questiontext
);
$questiontext
=
file_prepare_draft_area
(
$draftid
,
$this
->
context
->
id
,
'question'
,
'questiontext'
,
empty
(
$question
->
id
)
?
null
:
(
int
)
$question
->
id
,
$this
->
fileoptions
,
$questiontext
);
$question
->
questiontext
=
array
();
$question
->
questiontext
[
'text'
]
=
$questiontext
;
...
...
@@ -337,7 +337,7 @@ class question_edit_form extends moodleform {
$question
->
generalfeedback
=
''
;
}
$feedback
=
file_prepare_draft_area
(
$draftid
,
$this
->
context
->
id
,
'question'
,
'generalfeedback'
,
empty
(
$question
->
id
)
?
null
:
(
int
)
$question
->
id
,
null
,
$question
->
generalfeedback
);
$feedback
=
file_prepare_draft_area
(
$draftid
,
$this
->
context
->
id
,
'question'
,
'generalfeedback'
,
empty
(
$question
->
id
)
?
null
:
(
int
)
$question
->
id
,
$this
->
fileoptions
,
$question
->
generalfeedback
);
$question
->
generalfeedback
=
array
();
$question
->
generalfeedback
[
'text'
]
=
$feedback
;
$question
->
generalfeedback
[
'format'
]
=
empty
(
$question
->
generalfeedbackformat
)
?
editors_get_preferred_format
()
:
$question
->
generalfeedbackformat
;
...
...
question/type/multichoice/edit_multichoice_form.php
View file @
41dcc2a5
...
...
@@ -84,7 +84,7 @@ class question_edit_multichoice_form extends question_edit_form {
// prepare question text
$draftid
=
file_get_submitted_draft_itemid
(
'feedback['
.
$key
.
']'
);
$default_values
[
'feedback['
.
$key
.
']'
]
=
array
();
$default_values
[
'feedback['
.
$key
.
']'
][
'text'
]
=
file_prepare_draft_area
(
$draftid
,
$this
->
context
->
id
,
'question'
,
'answerfeedback'
,
empty
(
$answer
->
id
)
?
null
:
(
int
)
$answer
->
id
,
null
,
$answer
->
feedback
);
$default_values
[
'feedback['
.
$key
.
']'
][
'text'
]
=
file_prepare_draft_area
(
$draftid
,
$this
->
context
->
id
,
'question'
,
'answerfeedback'
,
empty
(
$answer
->
id
)
?
null
:
(
int
)
$answer
->
id
,
$this
->
fileoptions
,
$answer
->
feedback
);
$default_values
[
'feedback['
.
$key
.
']'
][
'format'
]
=
$answer
->
feedbackformat
;
$default_values
[
'feedback['
.
$key
.
']'
][
'itemid'
]
=
$draftid
;
$key
++
;
...
...
question/type/numerical/questiontype.php
View file @
41dcc2a5
This diff is collapsed.
Click to expand it.
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