Feedback field at end of quiz review page

Feedback field at end of quiz review page

por Jerin das -
Número de respostas: 14

I want to add a  editor field to enter a feedback at the end of review page of quiz by the teacher. I can see one option "Overall feedback"  for this purpose in moodle. But My client is not satisfied with that.He told me to put an individual feedback column to enter feedback which is independent of the grades.Now iam using the moodle 2.4. Actually iam new face to moodle.Please help me.

 

Thanks in advance

Jerin

Em resposta a 'Jerin das'

Re: Feedback field at end of quiz review page

por Tim Hunt -
Foto de Core developers Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Peer reviewers Foto de Plugin developers

If you want the same feedback irrespective of grade, then just fill in one "Overall feedback" box.

Em resposta a 'Tim Hunt'

Re: Feedback field at end of quiz review page

por Jerin das -

Thanks for your reply. But actually my requirement is different one.I want a teaxtarea to enter feedback at the end of review page  by the teacher. Individual student's attempt  should have different feedbacks. Thats my requirement. is there any possible way??

Thanks in advance

Jerin

Em resposta a 'Jerin das'

Re: Feedback field at end of quiz review page

por Tim Hunt -
Foto de Core developers Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Peer reviewers Foto de Plugin developers

Well, in Moodle, the teacher can add a comment to any question, using the 'Make comment or override grade' link.

I suggest that you add an essay question as the last question in the quiz, and make it worth zero marks. You could make the question text something like:

"You don't need to answer this question, but if there is anything in particular you would like help with, please leave a comment here for your teacher."

Em resposta a 'Tim Hunt'

Re: Feedback field at end of quiz review page

por Jerin das -

Thanks .. But this is not the complete requirement..  actually my intension is to put a custom feedback textarea and a submit button at the end of quiz review page after  all questions which can access (see) to teachers only. students cant see that.But they can see the feedback what the teacher type in it for that quiz. Iam in a critical situcation. I can't go forward without a help . So please help me.

Thanks In advance

Jerin

Em resposta a 'Jerin das'

Re: Feedback field at end of quiz review page

por Jerin das -

I put the textarea and button succefully. Now i want to put the action to form. And want to access the value from textarea and save into database.Which table is suitable for that? how can i understand the code structure?

pls help me

Thanks in advance

Jerin

Em resposta a 'Jerin das'

Re: Feedback field at end of quiz review page

por Tim Hunt -
Foto de Core developers Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Peer reviewers Foto de Plugin developers

"How can i understand the code structure?"

At the risk of sounding facetious, you read the code, and you think.

Are you sure you would not be better off with the solution I suggested. Even though it is not exactly what you want, you can do it now, without writing any code at all. If you are in a rush, that is going to be a much quicker and more reliable solution. You can then develop a solution that is exactly what your teachers what some time when you are not in a rush and panicing. Just a thought.

Given the type of questions you are asking, which are pretty basic thigns about Moodle development, I am not sure how much help I can give you quickly.

If you are looking for a quick and dirty hack, add two extra column to the quiz_attempts table (e.g. teachercomment and teachercommentformat). Documenation about Moodle forms library is here: http://docs.moodle.org/dev/lib/formslib.php

Em resposta a 'Jerin das'

Re: Feedback field at end of quiz review page

por Jerin das -

Hi,

can you give me an example for updating mysql table. I mean an example for "$DB->update_record($table, $dataobject, $bulk=false);"  with ' where ' condition.

thanks

Jerin

  

Em resposta a 'Jerin das'

Re: Feedback field at end of quiz review page

por Tim Hunt -
Foto de Core developers Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Peer reviewers Foto de Plugin developers

All database tables in Moodle have an id column as a primary key.

The $dataobject you pass to update_record shoul have a field

$dataobject->id = ... the appropriate id ...

So, you want code something like

$dataobject = new stdClass();
$dataobject->id = $attemptid;
$dataobject->teachercomment = $commentfromform;
$dataobject->teachercommentformat = $commentformatfromform;
$DB->update_record('quiz_attempts', $dataobject);

 

Em resposta a 'Tim Hunt'

Re: Feedback field at end of quiz review page

por Jerin das -

Thanks for reply.Its realy useful.But when i was integrated that code , the output page showing some error like "Coding error detected, it must be fixed by a programmer: moodle_database::update_record_raw() id field must be specified." .

how can i overcome tghis problem?I think its related to database connection.Is there any new files have to be call for $DB?

 

My code is shown below.

$attemptid=$attempt->id;
$dataobject = new stdClass();
$dataobject->id = $attemptid;
$dataobject->teacher_feedback =$feedback;
$DB->update_record('mdl_quiz_attempts', $dataobject);

the $dataobject array getting currectly.

Thanks

Jerin

Em resposta a 'Jerin das'

Re: Feedback field at end of quiz review page

por Tim Hunt -
Foto de Core developers Foto de Documentation writers Foto de Particularly helpful Moodlers Foto de Peer reviewers Foto de Plugin developers

$DB->update_record('mdl_quiz_attempts', $dataobject);

should be

$DB->update_record('quiz_attempts', $dataobject);

Moodle automatically adds the database prefix.

(I don't know why the error message is so unhelpful.)

By the way, do you have Debugging set to DEVELOPER level? That can help.

Em resposta a 'Tim Hunt'

Re: Feedback field at end of quiz review page

por Jerin das -

Hi,

 Thanks alot.Its working now.Now i could update the table.My next target  is to check the user roles for the visiblity of the textarea. The teachers can only visible that textarea and update the text. Students cannot update.They can only see the feedback which entered by the teacher.How is this possible?.Which code can i use for this purpose?please help me  with example.

Thanks

Jerin

Em resposta a 'Jerin das'

Re: Feedback field at end of quiz review page

por Jerin das -

Hi,

    My requirement is working fine  for old quizes.But when iam trying to attempt new quiz ,its showing some error "Error writing to database".Is this due to by the new database field in qiuz_attempt table?."

  • line 2362 of /lib/outputrenderers.php: call to core_renderer->header()
  • line 366 of /lib/setuplib.php: call to core_renderer->fatal_error()
  • line ? of unknownfile: call to default_exception_handler()

" this error is showing while debugging

please help me.

thanks

jerin

Em resposta a 'Jerin das'

Re: Feedback field at end of quiz review page

por Jerin das -

when i customize the startattempt.php page , that problem solved.But i dont want to take risk. so i created a new table and enter the feedback into that table.I think this will be more helpful while upgrading the moodle.Now i added form elements by using html_writer::start_tag functions.I added textarea by this method.can i change that textarea into our tinymce edittor by using html_writer::start_tag method?

Thanks

Jerin