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
fb1ee4d5
Commit
fb1ee4d5
authored
Dec 16, 2009
by
Sam Hemelryk
Browse files
mod-assignment MDL-21106 Changed itemid for online assignment from assignment->id to user->id
parent
a6ffb8ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
mod/assignment/type/online/assignment.class.php
View file @
fb1ee4d5
...
...
@@ -43,7 +43,6 @@ class assignment_online extends assignment_base {
/// prepare form and process submitted data
$mformdata
=
new
stdClass
;
$mformdata
->
assignmentid
=
$this
->
assignment
->
id
;
$mformdata
->
context
=
$this
->
context
;
$mformdata
->
maxbytes
=
$this
->
course
->
maxbytes
;
$mform
=
new
mod_assignment_online_edit_form
(
null
,
$mformdata
);
...
...
@@ -106,7 +105,7 @@ class assignment_online extends assignment_base {
}
else
{
echo
$OUTPUT
->
box_start
(
'generalbox boxwidthwide boxaligncenter'
,
'online'
);
if
(
$submission
&&
has_capability
(
'mod/assignment:exportownsubmission'
,
$this
->
context
))
{
$text
=
file_rewrite_pluginfile_urls
(
$submission
->
data1
,
'pluginfile.php'
,
$this
->
context
->
id
,
'assignment_online_submission'
,
$
this
->
assignment
->
id
);
$text
=
file_rewrite_pluginfile_urls
(
$submission
->
data1
,
'pluginfile.php'
,
$this
->
context
->
id
,
'assignment_online_submission'
,
$
USER
->
id
);
echo
format_text
(
$text
,
$submission
->
data2
);
$button
=
new
portfolio_add_button
();
$button
->
set_callback_options
(
'assignment_portfolio_caller'
,
array
(
'id'
=>
$this
->
cm
->
id
),
'/mod/assignment/locallib.php'
);
...
...
@@ -360,6 +359,7 @@ class assignment_online extends assignment_base {
class
mod_assignment_online_edit_form
extends
moodleform
{
public
function
set_data
(
$data
)
{
global
$USER
;
$editoroptions
=
$this
->
get_editor_options
();
if
(
!
isset
(
$data
->
text
))
{
$data
->
text
=
''
;
...
...
@@ -369,15 +369,16 @@ class mod_assignment_online_edit_form extends moodleform {
}
else
{
$data
->
textformat
=
$data
->
format
;
}
$data
=
file_prepare_standard_editor
(
$data
,
'text'
,
$editoroptions
,
$this
->
_customdata
->
context
,
$editoroptions
[
'filearea'
],
$
this
->
_customdata
->
assignment
id
);
$data
=
file_prepare_standard_editor
(
$data
,
'text'
,
$editoroptions
,
$this
->
_customdata
->
context
,
$editoroptions
[
'filearea'
],
$
USER
->
id
);
return
parent
::
set_data
(
$data
);
}
public
function
get_data
()
{
global
$USER
;
$data
=
parent
::
get_data
();
if
(
$data
)
{
$editoroptions
=
$this
->
get_editor_options
();
$data
=
file_postupdate_standard_editor
(
$data
,
'text'
,
$editoroptions
,
$this
->
_customdata
->
context
,
$editoroptions
[
'filearea'
],
$
this
->
_customdata
->
assignment
id
);
$data
=
file_postupdate_standard_editor
(
$data
,
'text'
,
$editoroptions
,
$this
->
_customdata
->
context
,
$editoroptions
[
'filearea'
],
$
USER
->
id
);
$data
->
format
=
$data
->
textformat
;
}
return
$data
;
...
...
mod/assignment/type/online/file.php
View file @
fb1ee4d5
...
...
@@ -59,7 +59,7 @@ if ($submission = $assignmentinstance->get_submission($user->id)) {
echo
'</table>'
;
echo
$OUTPUT
->
box_end
();
$text
=
file_rewrite_pluginfile_urls
(
$submission
->
data1
,
'pluginfile.php'
,
$context
->
id
,
'assignment_online_submission'
,
$
assignment
->
id
);
$text
=
file_rewrite_pluginfile_urls
(
$submission
->
data1
,
'pluginfile.php'
,
$context
->
id
,
'assignment_online_submission'
,
$
USER
->
id
);
echo
$OUTPUT
->
box
(
format_text
(
$text
,
$submission
->
data2
),
'generalbox boxaligncenter boxwidthwide'
);
echo
$OUTPUT
->
close_window_button
();
echo
$OUTPUT
->
footer
();
...
...
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