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
integration
prechecker
Commits
77371e2d
Commit
77371e2d
authored
Oct 05, 2016
by
Andrew Nicols
Browse files
Merge branch 'MDL-55767-master-fix1' of
http://github.com/damyon/moodle
parents
b31984d5
9b807e6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
admin/tool/lpimportcsv/classes/framework_importer.php
View file @
77371e2d
...
...
@@ -52,6 +52,7 @@ class framework_importer {
protected
$importid
=
0
;
protected
$importer
=
null
;
protected
$foundheaders
=
array
();
protected
$scalecache
=
array
();
/**
* Store an error message for display later
...
...
@@ -355,13 +356,17 @@ class framework_importer {
require_once
(
$CFG
->
libdir
.
'/gradelib.php'
);
$allscales
=
grade_scale
::
fetch_all_global
();
$matching
scale
=
false
;
foreach
(
$allscales
as
$scale
)
{
if
(
$scale
->
compact
_items
()
==
$scalevalues
)
{
$
matchingscale
=
$scale
;
if
(
empty
(
$this
->
scalecache
))
{
$all
scale
s
=
grade_scale
::
fetch_all_global
()
;
foreach
(
$allscales
as
$scale
)
{
$scale
->
load
_items
()
;
$
this
->
scalecache
[
$scale
->
compact_items
()]
=
$scale
;
}
}
$matchingscale
=
false
;
if
(
isset
(
$this
->
scalecache
[
$scalevalues
]))
{
$matchingscale
=
$this
->
scalecache
[
$scalevalues
];
}
if
(
!
$matchingscale
)
{
// Create it.
$newscale
=
new
grade_scale
();
...
...
@@ -371,6 +376,7 @@ class framework_importer {
$newscale
->
scale
=
$scalevalues
;
$newscale
->
description
=
get_string
(
'competencyscaledescription'
,
'tool_lpimportcsv'
);
$newscale
->
insert
();
$this
->
scalecache
[
$scalevalues
]
=
$newscale
;
return
$newscale
->
id
;
}
return
$matchingscale
->
id
;
...
...
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