Overall Feedback Doesn't Show

Overall Feedback Doesn't Show

by Ohad Kravchick -
Number of replies: 11
Hi,

I am quite a newbie of Moodle.
I have installed it on my Windows computer and it worked like a charm.
Then, as another step to deploy it in production, my IT person installed it on a Linux machine. Both work generally fine.

My problem is that the Overall Feedback (the feedback between 100% to x% and between x% and 0%) doesn't show in my quiz on my Linux Moodle no matter what I do. I tried removing any overrides I have made for any user, globally (Users -> Roles -> [Specific Role] -> Overrides), in a course (Courses -> add/remove a course -> [Specific Course] -> Define Roles -> [Specific Role] -> overrides), in the quiz (Courses -> add/remove a course -> [Specific Course] -> Quiz -> Edit -> overrides). Nothing helps.
I have created a brand new quiz, and a new quiz in a new course. Nothing. None shows the overall Feedback.

If you go to the list of quizzes in the course, you see the overall feedback. Then, if you click on the quiz itself, it doesn't show. In my other computer, it shows it right after "Your final grade for this quiz". Then, if you drill down into the review of it, you see the result.

I have checked and unchecked any Review Option under Edit the Quiz:
Immediately after the attempt v.s. Later, while the quiz is still open v.s. After the quiz is closed; Responses v.s. Answers v.s. Feedback v.s. General feedback v.s. Scores v.s. Overall feedback. Of couse, I have put an overall feedback, and it shows correctly in the review of the quiz.

Nothing helps.
If you need any logs / debug info, please ask for.
Also, please try to shoot at any direction. I understand that I probably did something wrong somewhere.

These are my environment:
Name Information Report Status
moodle
docs.gifversion 1.0 is required and you are running 1.9.5 OK
unicode
docs.gifmust be installed and enabled OK
database mysql docs.gifversion 4.1.16 is required and you are running 4.1.20 OK
php
docs.gifversion 4.3.0 is required and you are running 5.2.9 OK
php_extension iconv docs.gifshould be installed and enabled for best results OK
php_extension mbstring docs.gifshould be installed and enabled for best results OK
php_extension curl docs.gifshould be installed and enabled for best results OK
php_extension openssl docs.gifshould be installed and enabled for best results OK
php_extension tokenizer docs.gifshould be installed and enabled for best results OK
php_extension xmlrpc docs.gifshould be installed and enabled for best results OK
php_extension ctype docs.gifshould be installed and enabled for best results OK

The other (the one that works) is Windows, with mysql 5.X.
Attachment quiz.JPG
Average of ratings: -
In reply to Ohad Kravchick

Re: Overall Feedback Doesn't Show

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That is very weird. You seem to have thought of everything that might be configured wrongly, and checked that they are OK. I have never heard of other people having this problem before. I don't understand.
In reply to Tim Hunt

Re: Overall Feedback Doesn't Show

by Ohad Kravchick -
Hi Tim,

If there is anything you can try to troubleshoot it, please do. I would have, but I don't know how to debug in moodle yet.

I am providing you with the credentials for my moodle (don't worry - it's not in production):
the URL is: https://elearning.expand.com
Admin account: admin, password: 123456
Student account (although you can now create your own, but emails will not be received): ohadk, password: 123456
The Quiz is the only thing in the `ECCA Exam` course.

Please don't trash the place. wink

Thanks,
Ohad.
In reply to Ohad Kravchick

Re: Overall Feedback Doesn't Show

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The thing that immeditately strikes me as unusual is that you have given the Students permissions to see the quiz reports. Is that intentional. However that is not causing the problem.

Hmm. Looking a the code, the bit that must be going wrong is:

$feedbackcolumn = quiz_has_feedback($quiz->id);
$overallfeedback = $feedbackcolumn && $alloptions->overallfeedback;

That is around line 200 of mod/quiz/view.php.

Can I suggest you add the line

echo "<p>feedbackcolumn: $feedbackcolumn, overallfeedback: $overallfeedback</p>\n";

immediately after those two lines. Then go in as a student and tell us what that prints out.

In reply to Tim Hunt

Re: Overall Feedback Doesn't Show

by Ohad Kravchick -
About the quiz report permission, this is just a leftover from my tries.
I have also created another course with another quiz, and didn't change too much there, and still no output.

I wanted to debug the same lines myself before, but when I try to change the file (on my Windows Moodle), nothing happens (it stays the same). Do I need to do anything after changing the file manually?

I don't have write permission for the files yet in that server, I will ask for it from my IT person and keep you updated.
In reply to Ohad Kravchick

Re: Overall Feedback Doesn't Show

by Ohad Kravchick -

Ok. I finally was able to find the problem.

I could not get permissions to access the server. However, I had created the same environment on my own pc; this is important as the problem seems OS/DB related. The server is CentOS (CentOS 4.5; Linux Kernel 2.6.9-55.EL), with NGINX (0.8.30) with PHP (5.2.9) through FastCGI (spawn-fcgi-1.6.3) and mySQL (4.1.20); it uses Moodle 1.9.7 build 20091126.

The problem starts in /mod/quiz/locallib.php at quiz_has_feedback (line 345). It creates a query like: select * from quiz_feedback WHERE quizid=1 AND NOT feedbacktext='';

In /lib/dmllib.php In sql_isnotempty (line 1932), Moodle try to compare using "return ' ( NOT ' . sql_isempty($tablename, $fieldname, $nullablefield, $textfield) . ') ';"

The query returns no rows no matter what my table contains.

See:

mysql> select * from quiz_feedback WHERE quizid=1;
+----+--------+--------------+----------+----------+
| id | quizid | feedbacktext | mingrade | maxgrade |
+----+--------+--------------+----------+----------+
|  1 |      1 | Good         |        5 |       11 |
|  2 |      1 | Bad          |        0 |        5 |
+----+--------+--------------+----------+----------+
2 rows in set (0.00 sec)

mysql> select * from quiz_feedback WHERE quizid=1 AND NOT feedbacktext='';
Empty set (0.00 sec)

mysql> select * from quiz_feedback WHERE quizid=1 AND feedbacktext='Good';
+----+--------+--------------+----------+----------+
| id | quizid | feedbacktext | mingrade | maxgrade |
+----+--------+--------------+----------+----------+
|  1 |      1 | Good         |        5 |       11 |
+----+--------+--------------+----------+----------+
1 row in set (0.00 sec)

mysql> select * from quiz_feedback WHERE quizid=1 AND NOT feedbacktext='Good';
Empty set (0.00 sec)

It appears that NOT doesn't interact well with = comparizon for string.

Instead, this should be used:

mysql> select * from quiz_feedback WHERE quizid=1 AND feedbacktext<>'';
+----+--------+--------------+----------+----------+
| id | quizid | feedbacktext | mingrade | maxgrade |
+----+--------+--------------+----------+----------+
|  1 |      1 | Good         |        5 |       11 |
|  2 |      1 | Bad          |        0 |        5 |
+----+--------+--------------+----------+----------+
2 rows in set (0.00 sec)

or strcmp, or "not like", etc. Perhaps only for mysql.

Am I doing something wrong? Or can I fix it in an easy manner without changing the code? Also, should I open a JIRA for it?

In reply to Ohad Kravchick

Re: Overall Feedback Doesn't Show

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Great detective work to find this cause.

The person who knows most about this sort of thing is Eloy (stronk7), but he is on holiday at the moment. I created MDL-21264, which I am sure he will look at on his return.

My guess is that it depends whether that column contains NULL or '' - but I thought that column should be not-null.
In reply to Tim Hunt

Re: Overall Feedback Doesn't Show

by Ohad Kravchick -

The column doesn't allow nulls:

mysql> describe quiz_feedback;
+--------------+---------------------+------+-----+---------+----------------+
| Field        | Type                | Null | Key | Default | Extra          |
+--------------+---------------------+------+-----+---------+----------------+
| id           | bigint(10) unsigned |      | PRI | NULL    | auto_increment |
| quizid       | bigint(10) unsigned |      | MUL | 0       |                |
| feedbacktext | text                |      |     |         |                |
| mingrade     | double              |      |     | 0       |                |
| maxgrade     | double              |      |     | 0       |                |
+--------------+---------------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)

I will also update the issue.

In reply to Ohad Kravchick

Re: Overall Feedback Doesn't Show

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
In that case why is

NOT feedbacktext = ''

different from

feedbacktext <> ''

?


Ah, it must be an operator precidence thing. Needs to be

NOO (feedbacktext = '')

Please could you test that possibility. Thanks.
In reply to Tim Hunt

Re: Overall Feedback Doesn't Show

by Ohad Kravchick -

Tim,

You were right.

Take a look:

mysql> select * from quiz_feedback where (NOT feedbacktext='');
Empty set (0.00 sec)

mysql> select * from quiz_feedback where NOT (feedbacktext='');
+----+--------+--------------+----------+----------+
| id | quizid | feedbacktext | mingrade | maxgrade |
+----+--------+--------------+----------+----------+
|  1 |      1 | Good         |        5 |       11 |
|  2 |      1 | Bad          |        0 |        5 |
+----+--------+--------------+----------+----------+
2 rows in set (0.00 sec)

And the sql_isnotempty does: (NOT feedbacktext='').

It's weird that mySql on my machine behaves differently.