2.8.3 Getting rid of stats at the end of a lesson

2.8.3 Getting rid of stats at the end of a lesson

by Wendi Daniels -
Number of replies: 7

I am trying to figure out how I get rid of the stats at the end of a lesson. After they answer the practice questions, they get this, as an example:


**************************************************************

Number of questions answered: 2

Number of correct answers: 2

Your score is 2 (out of 2).

Your current grade is 0.0 out of 0

******************************************************************


I want all of this to be gone. How do I do that?

Average of ratings: -
In reply to Wendi Daniels

Re: 2.8.3 Getting rid of stats at the end of a lesson

by Wendi Daniels -

This is just silly. I have gone through everything I can see in both the course, and the site, and still these items remain. Why does this have to be so difficult and silly? Why can't we click the buttons, and then have the site do what we just asked it to do, especially when we visit a few pages, site and course, and make the correct requests? I have been at this for a while, and I can't believe the system is not doing what I have checked and unchecked.

In reply to Wendi Daniels

Re: 2.8.3 Getting rid of stats at the end of a lesson

by Wendi Daniels -

So,  I scroll to "no" in a lesson module under the option of "display ongoing score", but it still displays ongoing score. Under "grade" I choose "none" (no grade). I select "practice lesson" so that it is not a part of their grade. I check "no" for "custom scoring". In site admin > grades > report settings > user report, I hide everything except "feedback". In (my course) >  Grade administration > setup > course grade settings, I hide everything except "feedback".


With all of this, I can't get rid of that damned box???  Why is this so ridiculous? What is the magic step to get rid of that box? It is confusing my students, who think it's part of their grade, and some of them have left due to the confusion of that box. Someone please help.


Do any moderators know the answer to this?

In reply to Wendi Daniels

Re: 2.8.3 Getting rid of stats at the end of a lesson

by Wendi Daniels -

Could one of the moderators direct me to the person who wrote this script?

In reply to Wendi Daniels

Re: 2.8.3 Getting rid of stats at the end of a lesson

by Wendi Daniels -

All of the buttons seem ineffective, so my solution was to go to mod/lesson/view and alter the following lines (479-503 in my version of 8.


       } else {
            if ($lesson->timed) {
                if ($outoftime == 'normal') {
                    $grade = new stdClass();
                    $grade->lessonid = $lesson->id;
                    $grade->userid = $USER->id;
                    $grade->grade = 0;
                    $grade->completed = time();
                    if (!$lesson->practice) {
                        $newgradeid = $DB->insert_record("lesson_grades", $grade);
                    }
                    $lessoncontent .= get_string("eolstudentoutoftimenoanswers", "lesson");
                }
            } else {
        
            }
        }

        // update central gradebook
        lesson_update_grades($lesson, $USER->id);

    } else {
        // display for teacher
        $lessoncontent .= $lessonoutput->paragraph(get_string("lesson"), 'center');
    }

In reply to Wendi Daniels

Re: 2.8.3 Getting rid of stats at the end of a lesson

by Wendi Daniels -

Seriously, is there a chance we could remove all of the worthless buttons, or make them work? It's as irritating as hell to go on a wild goose chase with buttons that don't do anything.

In reply to Wendi Daniels

Re: 2.8.3 Getting rid of stats at the end of a lesson

by Wendi Daniels -

Jean-Michel, thank you so much! Thank you also for making the change in the next edition. When I wrote my last 2 entries, for whatever reason, I did not yet see your entry. I meant no disrespect. I was very, very frustrated after spending an enormous amount of time checking all the right buttons only to get no where. I greatly appreciate your contributions, as well as all of the free contributions on Moodle, including the platform itself. I am sorry I was so demanding. I could have behaved better.  I hang my head in well-deserved shame.   sad

In reply to Wendi Daniels

Re: 2.8.3 Getting rid of stats at the end of a lesson

by Jean-Michel Védrine -

Hello Wendi,

To suppress the display of:

Number of questions answered: 2

Number of correct answers: 2

Set "Custom scoring" to "Yes"

To suppress the display of:

Your current grade is 0.0 out of 0

There is no way to do that in Moodle 2.8.x sad but it will be fixed in Moodle 2.9 because I just fixed it this week, see MDL-18553 smile ). So in Moodle 2.9 if you set "Grade type" to "None" then there will be no display of "Your current grade is ...

If you are prepared to edit one of your Moodle files, then I can give the change I made for Moodle 2.9, because it's just a few lines to change, you need to the file edit mod/lesson/view.php

change line 337
$lesson->add_message(get_string('yourcurrentgradeisoutof', 'lesson', $a), 'notify');

to:
if ($lesson->grade != 0) {

$lesson->add_message(get_string('yourcurrentgradeisoutof', 'lesson', $a), 'notify');

}

And finally change line 466
$lessoncontent .= $lessonoutput->paragraph(get_string("yourcurrentgradeisoutof", "lesson", $a), 'center');

to:
if ($lesson->grade != 0) {

    $lessoncontent .= $lessonoutput->paragraph(get_string("yourcurrentgradeisoutof", "lesson", $a), 'center');

}

Be warned that lines numbers can be a little different if you have already modified that file or if your Moodle 2.8.3 version is not up to date.

But the bad news is that currently there is no way to suppress the display of
Your score is 2 (out of 2).
If you think this is a bug, create an issue in the tracker, but the problem is that I don't see what lesson setting should control that feature and I am against adding a new setting because there is already too much settings and there are very confusing.

Last thing, due to life constraints I am currently unable to visit these forums as often as I was used to, so if you post an answer, don't expect a quick answer sad sorry.