Deleting a Scale from Gradebook

Deleting a Scale from Gradebook

by Daniel Smith -
Number of replies: 16

Hi all

(Hope this is in the right place, forgive me if it's not)

I would like to delete one of the custom scales I have created in the gradebook. It is a site-wide scale and is in use 3 times somewhere on our Moodle, so I understand this means I can't delete it.

Is there a way I can see where the scale is being used (without having to go in every course and check each assignment etc)?

Many thanks

Daniel

In reply to Daniel Smith

Re: Deleting a Scale from Gradebook

by rafal morusiewicz -
Two years later, I have basically the same question: how to locate in which courses scales are used in order to be able to delete them? Help! I'm using Moodle 1.9.5.
In reply to rafal morusiewicz

Re: Deleting a Scale from Gradebook

by Tiffany Morgan -
Hi Rafal
I haven't tried this, as we are using all of our site-wide custom scales. But I would assume if the scale is site wide then the site admin would have created it via admin>grades>scales and it would need to be deleted via that same method.

What I dont know is if it the scale is being used (which is indicated on the admin>grades>scales) and the scale is deleted will that scale be deleted or retained on those courses which use it. I would be interested to know what you find out about this..

Good luck!
In reply to Tiffany Morgan

Re: Deleting a Scale from Gradebook

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Tiffany - I am not sure you can delete a scale that is being used in assignments.
In reply to Mary Cooch

Re: Deleting a Scale from Gradebook

by Tiffany Morgan -
You are exactly right smile Checked on mine and the the delete option is gone for the scale which is in use and visible for the scale which is not in use.
Thanks! smile
In reply to Tiffany Morgan

Re: Deleting a Scale from Gradebook

by Dan Jeffries -
I really need to know this too!

Trouble is, if you have 100s of assignments around the site, it would take forever to figure out which one is using the scale you want to delete!

There must be a way to finding this out...


In reply to Dan Jeffries

Re: Deleting a Scale from Gradebook

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
You can't delete a scale that is in use. It doesn't have the delete button available. So are you trying to say -you want a way of knowing which assignments use this scale, so you can go and take the scale out of those assignments((change it to a different scale) so you can then delete that particular scale?I'd like to know that too smile But what I don't get is - if a scale is used a lot, then why would you want to delete it?
In reply to Mary Cooch

Re: Deleting a Scale from Gradebook

by Dan Jeffries -
Some of our tutors imported in Courses from other sites and unfortunately imported the Scale with it.

I asked them to change the Scale to our new one, which they say they have done, yet the Scale still shows its being used.

mixed
In reply to Mary Cooch

Re: Deleting a Scale from Gradebook

by rafal morusiewicz -
Mary,
What I want to establish first is to where the scales are used. I guess they must have been used in some derelict testing courses where our platform participants learned how to use Moodle. Since there's quite a lot of such courses, I would rather not go through all of them step by step to find it.
In reply to Dan Jeffries

Re: Deleting a Scale from Gradebook

by Elena Ivanova -
Hi Dan,
I have asked our programmers to figure that out for me last time. They gave me a list of scales and courses/assignments where those were used.
Then they run some script and it switched all assignment that used the "wrong" scale to No Grade.
In reply to Elena Ivanova

Re: Deleting a Scale from Gradebook

by Dan Jeffries -
That sounds immensely useful! *wink wink*

Any chance of getting the code? I wouldn't know where to start!

smile
In reply to Dan Jeffries

Re: Deleting a Scale from Gradebook

by Elena Ivanova -
There is no code per ce to run. One has to run a query on the database tables, and I have rather vague idea on how to do that shy (may be you can ask here?)
In reply to Elena Ivanova

Re: Deleting a Scale from Gradebook

by Tiffany Morgan -
I'm still having this problem and wondering if this should be added as a bug? It seems that if removing the use of a scale is a prereq of deleting it, then there should be a way within the admin to identify those courses in which it is used.
In reply to Tiffany Morgan

Re: Deleting a Scale from Gradebook

by Teresa Gibbison -
Hi there
As Elena indicated you'll need to query the database to find this information.

First you need to know the id number of the scale. Check this in the mdl_scale table with a query similar to this (alternatively just select * from mdl_scale to get all rows!):
select id, name, scale from mdl_scale where name = 'name of scale';
Once you have the id number of the scale (say it's '10') you can search the msl_grade_items table for the items using that scale with a query similar to this:
select id, courseid, itemname, scaleid from mdl_grade_items where scaleid=10;
Once you've gone through those courses and changed the grade item's scale to something else you should be able to remove the scale.

I hope this helps
Cheers
Teresa
In reply to Daniel Smith

Re: Deleting a Scale from Gradebook

by Kartikesh Saurkar -

Check that if that scale is being used somewhere. Go to scales then see if used is yes , then you can't delete the scale. Go to Grader report then see in which grade item you are using that scale. You can identify the grade item in which the scale is used by seeing the options of scale. Go to edit settings of grade item. See for the option grade type grade type it is set to scale, make it value. Now go to scale, now you can delete the scale showing status used:No.

In reply to Daniel Smith

Re: Deleting a Scale from Gradebook

by C Behan -

Re: Is there a way I can see where the scale is being used (without having to go in every course and check each assignment etc)?


It's many years since this question was first posed but I had the same issue today. I resolved it using the Configurable Reports plugin and the following SQL Query:


SELECT prefix_course.fullname AS Course, prefix_course.shortname AS "Course Short Name", prefix_grade_items.itemname AS "Graded Item Name", prefix_grade_items.itemmodule AS "Graded Item Type" 

FROM  prefix_grade_items

INNER JOIN prefix_course 

ON prefix_grade_items.courseid=prefix_course.id

WHERE prefix_grade_items.scaleid="[SCALE ID NUMBER]"