Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-local_archive
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
uw-moodle
moodle-local_archive
Commits
a31c8d74
Commit
a31c8d74
authored
10 years ago
by
Matt Petro
Browse files
Options
Downloads
Patches
Plain Diff
UWMOODLE-212: Upgrading assignments to 2.3
Task-Url:
https://jira.doit.wisc.edu/jira/browse/UWMOODLE-212
parent
a2bd39ce
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
lang/en/local_archive.php
+3
-2
3 additions, 2 deletions
lang/en/local_archive.php
lib.php
+31
-0
31 additions, 0 deletions
lib.php
locallib.php
+6
-1
6 additions, 1 deletion
locallib.php
settings.php
+3
-0
3 additions, 0 deletions
settings.php
version.php
+2
-2
2 additions, 2 deletions
version.php
with
45 additions
and
5 deletions
lang/en/local_archive.php
+
3
−
2
View file @
a31c8d74
...
@@ -3,6 +3,7 @@ $string['pluginname'] = 'WISC archive plugin';
...
@@ -3,6 +3,7 @@ $string['pluginname'] = 'WISC archive plugin';
$string
[
'pluginname_desc'
]
=
'<p>This plugin enables importing of course archives stored in server directories.</p>'
;
$string
[
'pluginname_desc'
]
=
'<p>This plugin enables importing of course archives stored in server directories.</p>'
;
$string
[
'archive:anyarchive'
]
=
'Import any archive'
;
$string
[
'archive:anyarchive'
]
=
'Import any archive'
;
$string
[
'archive:dolocalimport'
]
=
'Perform native moodle import'
;
$string
[
'searchcourse'
]
=
'Course full name'
;
$string
[
'searchcourse'
]
=
'Course full name'
;
$string
[
'searchsubject'
]
=
'Department'
;
$string
[
'searchsubject'
]
=
'Department'
;
$string
[
'searchcatalog'
]
=
'Catalog number'
;
$string
[
'searchcatalog'
]
=
'Catalog number'
;
...
@@ -19,8 +20,8 @@ $string['selectarchives'] = 'Select which archives to scan';
...
@@ -19,8 +20,8 @@ $string['selectarchives'] = 'Select which archives to scan';
$string
[
'default_moodle_import_link_text'
]
=
'Import (current site)'
;
$string
[
'default_moodle_import_link_text'
]
=
'Import (current site)'
;
// Settings string
// Settings string
$string
[
'settings_page_name'
]
=
'
Configure
WISC archive plugin'
;
$string
[
'settings_page_name'
]
=
'WISC archive plugin'
;
$string
[
'override_link_setting'
]
=
'Override default import url'
;
$string
[
'override_link_setting'
]
=
'Override default import url'
;
$string
[
'override_link_setting_desc'
]
=
'<p>This setting will change the default import link in course administration to the WISC archive '
.
$string
[
'override_link_setting_desc'
]
=
'<p>This setting will change the default import link in course administration to the WISC archive '
.
'import functionality instead the default.</p><p>For users with the local/archive:dolocalimport capability, both links will be displayed.</p>'
;
'import functionality instead the default.</p><p>For users with the local/archive:dolocalimport capability, both links will be displayed.</p>'
;
$string
[
'upgrade_assignment22'
]
=
'Automatically upgrade Moodle 2.3 assignments'
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib.php
+
31
−
0
View file @
a31c8d74
...
@@ -85,6 +85,37 @@ function local_archive_extends_settings_navigation($settingsnav, $context){
...
@@ -85,6 +85,37 @@ function local_archive_extends_settings_navigation($settingsnav, $context){
}
}
}
}
/**
* Local archive cron
*/
function
local_archive_cron
()
{
// Upgrade assignments 2.2 by cron, in case some courses have been manually restored.
mtrace
(
'Upgrading moodle 2.2 assignments'
);
$output
=
local_archive_batch_upgrade_assignments
();
mtrace
(
$output
);
mtrace
(
'done.'
);
}
/**
* Batch upgrade assignment 2.2 to moodle 2.3 assign
*/
function
local_archive_batch_upgrade_assignments
()
{
global
$CFG
;
if
(
!
get_config
(
'local_archive'
,
'upgrade_assignment22'
))
{
return
;
}
// Don't want to load this unless necessary
require_once
(
$CFG
->
dirroot
.
'/'
.
$CFG
->
admin
.
'/tool/assignmentupgrade/locallib.php'
);
$output
=
""
;
$assignmentids
=
tool_assignmentupgrade_load_all_upgradable_assignmentids
();
foreach
(
$assignmentids
as
$assignmentid
)
{
list
(
$summary
,
$success
,
$log
)
=
tool_assignmentupgrade_upgrade_assignment
(
$assignmentid
);
$output
.
=
$summary
->
name
.
': '
.
(
$success
?
'OK'
:
'ERROR'
)
.
' '
.
$log
.
"
\n
"
;
}
return
$output
;
}
This diff is collapsed.
Click to expand it.
locallib.php
+
6
−
1
View file @
a31c8d74
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
define
(
'LOCAL_ARCHIVE_TEACHER_ROLE'
,
1
);
define
(
'LOCAL_ARCHIVE_TEACHER_ROLE'
,
1
);
require_once
(
$CFG
->
dirroot
.
'/local/archive/lib.php'
);
require_once
(
$CFG
->
dirroot
.
'/local/archive/storagetype/base.php'
);
require_once
(
$CFG
->
dirroot
.
'/local/archive/storagetype/base.php'
);
require_once
(
$CFG
->
dirroot
.
'/local/archive/storagetype/moodle.php'
);
require_once
(
$CFG
->
dirroot
.
'/local/archive/storagetype/moodle.php'
);
require_once
(
$CFG
->
dirroot
.
'/local/archive/storagetype/moodle1.php'
);
require_once
(
$CFG
->
dirroot
.
'/local/archive/storagetype/moodle1.php'
);
...
@@ -380,5 +381,9 @@ function local_archive_execute_restore($courseid, $importid, $restoretarget = ba
...
@@ -380,5 +381,9 @@ function local_archive_execute_restore($courseid, $importid, $restoretarget = ba
// Delete the temp directory now
// Delete the temp directory now
fulldelete
(
$tempdestination
);
fulldelete
(
$tempdestination
);
}
// Upgrade any assignment 2.2 items
// This will probably fail to do anything for non-admins, so we'll rely on cron most of the time.
local_archive_batch_upgrade_assignments
();
}
This diff is collapsed.
Click to expand it.
settings.php
+
3
−
0
View file @
a31c8d74
...
@@ -24,6 +24,9 @@ if ($hassiteconfig) {
...
@@ -24,6 +24,9 @@ if ($hassiteconfig) {
$settings
->
add
(
new
admin_setting_configcheckbox
(
'local_archive/enable_menu_override'
,
get_string
(
'override_link_setting'
,
'local_archive'
),
$settings
->
add
(
new
admin_setting_configcheckbox
(
'local_archive/enable_menu_override'
,
get_string
(
'override_link_setting'
,
'local_archive'
),
get_string
(
'override_link_setting_desc'
,
'local_archive'
),
1
));
get_string
(
'override_link_setting_desc'
,
'local_archive'
),
1
));
$settings
->
add
(
new
admin_setting_configcheckbox
(
'local_archive/upgrade_assignment22'
,
get_string
(
'upgrade_assignment22'
,
'local_archive'
),
''
,
1
));
$ADMIN
->
add
(
'localplugins'
,
$settings
);
$ADMIN
->
add
(
'localplugins'
,
$settings
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
version.php
+
2
−
2
View file @
a31c8d74
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
();
defined
(
'MOODLE_INTERNAL'
)
||
die
();
$plugin
->
version
=
20140
5
200
1
;
$plugin
->
version
=
20140
61
200
;
$plugin
->
release
=
'2.2'
;
$plugin
->
release
=
'2.2'
;
$plugin
->
requires
=
2013111801
;
// See http://docs.moodle.org/dev/Moodle_Versions
$plugin
->
requires
=
2013111801
;
// See http://docs.moodle.org/dev/Moodle_Versions
$plugin
->
cron
=
0
;
$plugin
->
cron
=
30
0
;
$plugin
->
component
=
'local_archive'
;
$plugin
->
component
=
'local_archive'
;
$plugin
->
maturity
=
MATURITY_BETA
;
$plugin
->
maturity
=
MATURITY_BETA
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment