Moodle
  1. Moodle
  2. MDL-24255

Not using the proper editor element for manually grading questions

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.1
    • Component/s: Questions
    • Labels:
      None
    • Testing Instructions:
      Hide

      1. As teacher, go to a quiz with student attempts
      2. Review an attempt, and manually grade a response using the Make comment & override grade.
      3. Go to Results -> Manual grading in the navigtion, and manually grade using that.
      In both cases, verify the grade and comment are saved, and can be re-edited.

      Ideally verify this with the Use HTML editor option in your profile both on and off.

      Show
      1. As teacher, go to a quiz with student attempts 2. Review an attempt, and manually grade a response using the Make comment & override grade. 3. Go to Results -> Manual grading in the navigtion, and manually grade using that. In both cases, verify the grade and comment are saved, and can be re-edited. Ideally verify this with the Use HTML editor option in your profile both on and off.
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      917

      Description

      While playing with quizzes/questions to detect all the file_areas I have detected that the question_sessions->manualcomment is lacking support for files (and that's ok, as commented by Tim in HQ chat) but, at the same time, it seems that the question_sessions->manualcommentformat field isn't being handled at all.

      I get the html editor (without showing any "format"), then save the comment and, the manualcommentformat continues being 0 (FORMAT_MOODLE) should be 1 (FORMAT_HTML).

      So I guess something is missing there (mod/quiz/comment.php)

      Ciao

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          Dongsheng, can you do this, or do I need to take a look? Thanks.

          Show
          Tim Hunt added a comment - Dongsheng, can you do this, or do I need to take a look? Thanks.
          Hide
          Dongsheng Cai added a comment -

          Hi, Tim

          I got a stupid question: how to go to manualcomment UI? Is it in quiz?

          Show
          Dongsheng Cai added a comment - Hi, Tim I got a stupid question: how to go to manualcomment UI? Is it in quiz?
          Hide
          Tim Hunt added a comment -

          The manualcomment UI is shown with the question, so it appears in two place.

          1. When a teacher reviews a student's quiz attempt, there is a "Make comment or override grade" link that opens the commenting UI in a pop-up.

          2. Also in the quiz, for a quiz with an essay question, go to Results -> Manual grading, and select one of the essay questions in the quiz, then follow the link to grade something.

          Show
          Tim Hunt added a comment - The manualcomment UI is shown with the question, so it appears in two place. 1. When a teacher reviews a student's quiz attempt, there is a "Make comment or override grade" link that opens the commenting UI in a pop-up. 2. Also in the quiz, for a quiz with an essay question, go to Results -> Manual grading, and select one of the essay questions in the quiz, then follow the link to grade something.
          Hide
          Dongsheng Cai added a comment -

          Hi, Tim

          Thanks.

          I read the code of mod/quiz/comment.php, looks like comment.php is not using moodle form at the moment, to convert to moodle form we need make more changes in lib/questionlib.php, I am not sure if worth doing this.

          Another quick fix would be hard-coded format in question_save_session function.

          Tim, what is your suggestion on this issue?

          Show
          Dongsheng Cai added a comment - Hi, Tim Thanks. I read the code of mod/quiz/comment.php, looks like comment.php is not using moodle form at the moment, to convert to moodle form we need make more changes in lib/questionlib.php, I am not sure if worth doing this. Another quick fix would be hard-coded format in question_save_session function. Tim, what is your suggestion on this issue?
          Hide
          Tim Hunt added a comment -

          Sorry, why is it relevant whether this uses formslib or not? We just need an editor, with associated choice of format. That must be possible without converting everything to formslib.

          Show
          Tim Hunt added a comment - Sorry, why is it relevant whether this uses formslib or not? We just need an editor, with associated choice of format. That must be possible without converting everything to formslib.
          Hide
          Dongsheng Cai added a comment -

          Hi Tim

          print_textarea has been deprecated (it is in deprecatedlib.php), it is not like the editor element which is able to deal with format and files, we replaced a number of textarea with moodle form element.

          The select box can be added to select format, but in the long term, I think it should use moodle form instead.

          Show
          Dongsheng Cai added a comment - Hi Tim print_textarea has been deprecated (it is in deprecatedlib.php), it is not like the editor element which is able to deal with format and files, we replaced a number of textarea with moodle form element. The select box can be added to select format, but in the long term, I think it should use moodle form instead.
          Hide
          Tim Hunt added a comment -

          I don't believe it is possible to use a Moodle form for this bit of the question code.

          I am sure it should be possible to use a HTML editor outside a Moodle form.

          Show
          Tim Hunt added a comment - I don't believe it is possible to use a Moodle form for this bit of the question code. I am sure it should be possible to use a HTML editor outside a Moodle form.
          Hide
          Sam Marshall added a comment -

          Changing difficulty, this one does not seem 'easy'.

          Show
          Sam Marshall added a comment - Changing difficulty, this one does not seem 'easy'.
          Hide
          Tim Hunt added a comment -

          The real issue is that there seems to be no way to use the new content editor stuff outside a Moodle form, so question_print_comment_fields cannot be changed to work properly. It has to use the old print_textarea function, and so we don't get a manualcommentformat field.

          I have now changed to code to set manualcommentformat to FORMAT_HTML wherever necessary. That will basically work, so this does not have to block the Moodle 2.0 release. However, the mess needs to be sorted out some time.

          Show
          Tim Hunt added a comment - The real issue is that there seems to be no way to use the new content editor stuff outside a Moodle form, so question_print_comment_fields cannot be changed to work properly. It has to use the old print_textarea function, and so we don't get a manualcommentformat field. I have now changed to code to set manualcommentformat to FORMAT_HTML wherever necessary. That will basically work, so this does not have to block the Moodle 2.0 release. However, the mess needs to be sorted out some time.
          Hide
          Tim Hunt added a comment -

          The code in qbehaviour_renderer::manual_comment_fields in question/behaviour/rendererbase.php needs to be updated to use code like in question/type/essay/renderer.php qtype_essay_format_editor_renderer::response_area_input

          Show
          Tim Hunt added a comment - The code in qbehaviour_renderer::manual_comment_fields in question/behaviour/rendererbase.php needs to be updated to use code like in question/type/essay/renderer.php qtype_essay_format_editor_renderer::response_area_input
          Hide
          Tim Hunt added a comment -

          I wish there was a better API for using the HTML editor outside formslib.php.

          Show
          Tim Hunt added a comment - I wish there was a better API for using the HTML editor outside formslib.php.
          Hide
          Sam Hemelryk added a comment -

          Thanks Tim - after talking to you I am happy to integrate this.
          I will open an issue to deprecate editors_head_setup() now.

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Thanks Tim - after talking to you I am happy to integrate this. I will open an issue to deprecate editors_head_setup() now. Cheers Sam
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Seems to work properly, both from the manual grading and the review attempt interfaces. Both comment and overridden grade.

          Show
          Eloy Lafuente (stronk7) added a comment - Seems to work properly, both from the manual grading and the review attempt interfaces. Both comment and overridden grade.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          U.P.S.T.R.E.A.M

          Show
          Eloy Lafuente (stronk7) added a comment - U.P.S.T.R.E.A.M

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: