Findin and deleting Scales!

Findin and deleting Scales!

by Dan Jeffries -
Number of replies: 5
Hi!

I am by no means a database expert (far from it!) but I would like to know if it's possible to detect which scales are being used on which assignments.

Some tutors have imported 'dead' scales from other courses and I cannot seem to find them.

Is this possible?

I have asked this in the Database section but had no response!

Thanks!

Dan
Average of ratings: -
In reply to Dan Jeffries

Re: Findin and deleting Scales!

by Colin Fraser -
Picture of Documentation writers Picture of Testers
As far as I am aware, you can add, edit and delete scales using the icons in the Action column. The problem is that once you have used the grade book, the the buttons no longer appear and there is no way to change them. This is actually self protection, when you think about it, from the Teacher's perspective, do it for one, do it for all.

However, there is always hope in Moodle. I am not surprised there was no response in the database forum, I don't think this is actually a database issue. Try this:

Back your course up and DO NOT backup ANY user data. Keep the course files AND the Teacher assignment - but leave EVERYTHING else behind. Restore the course as a new course and check out the grade book. If this works, you can backup your courses keeping the original and complete data or delete them as you need. Try it on your test Moodle first - but it should work.
In reply to Colin Fraser

Re: Findin and deleting Scales!

by Donna Hrynkiw -
If Dan's having the same problems we are, he's not asking from a teacher's point of view, but an administrator's. We're having the same problem.

We'd like to retire (delete from the system) one of the grading scales. However, once a scale is in use in any course we lose the ability to remove it.

If I'm interpreting Dan's request correctly, it's the same request I have -- how do I, as a Moodle administrator, track down which courses are using a given scale?

Donna Hrynkiw
Kwantlen Polytechnic
In reply to Colin Fraser

Re: Findin and deleting Scales!

by Dan Jeffries -
Thanks for the suggestion but there are 100s of courses and this would just take forever.
In reply to Dan Jeffries

Re: Findin and deleting Scales!

by Donna Hrynkiw -
(Second attempt at posting.)

And now having gotten a bee in my bonnet about finally getting rid of that scale that's been annoying me for so long, I've figured out a solution. It's probably not the most elegant, but it's functional.

In a test course, create an assignment with a distinctive name (mine: "Donna's Greek Assignment") and choose the offending scale for the Grade.

Login to your database and run this query:
mysql> SELECT course, name, grade FROM `mdl_assignment` WHERE name like "%Greek%";

My result:
+--------+--------------------------+-------+
| course | name | grade |
+--------+--------------------------+-------+
| 2600 | Donna's Greek Assignment | -2 |
+--------+--------------------------+-------+

course = the course id
name = name of the assignment
grade = the id of the offending scale, yours will probably differ

Now run a query to find all the other assignments using that same scale:
mysql> SELECT course, name FROM `mdl_assignment` WHERE `grade`=-2 order by course;
+--------+---------------------------------------------------------+
| course | name |
+--------+---------------------------------------------------------+
| 2600 | Donna's Greek Assignment |
| 2949 | Preventing STDs Handout |
| 2949 | Growth Chart Assignment |
| 2949 | Accident Prevention Assignment |
| 2949 | Iron Deficiency Anemia Teaching Plan |
| 2949 | Diabetes |
| 3078 | Facts Poem - Part 4 |
| 3079 | Revisions |
| 3079 | Portfolio |
| 3079 | Assignment 3 Due |
| 3079 | Assignment 4 Due |
etc

Use the course ID to track down which course hosts the assignment with the offending scale.
https://your.moodle.site/courses/course/view.php?id=2600

Now all I have to do is compose an e-mail telling the teachers to change the scale before I delete it. Hm. All this rests on the assumption that if all the assignments are changed to some other scale, the offending scale will be available to be deleted. I'll let you know.

Donna Hrynkiw
Pleased that she's *finally* able to give back to the community who has supported her Moodle activities for so long.
Kwantlen Polytechnic

ETA: to correct a typo
In reply to Donna Hrynkiw

Re: Findin and deleting Scales!

by Dan Jeffries -
Brilliant Donna - many thanks!!

I will ask my IT guy to test this out next week. I don't have a clue on how to use MYSQL so best leave him too it.

Let's hope this works!

Dan