Moodle
  1. Moodle
  2. MDL-26969

Upload file assignment submission problem

    Details

    • Database:
      MySQL
    • Testing Instructions:
      Hide

      1. Login as teacher and add advanced upload assignment.
      2. Login as student and go the assignment page
      3. Upload a file to the system (without pressing the Save Changes button).
      4. Click on any pages other than the current assignment page.
      5. Click the assignment title again and the student will get the message "No files submitted yet".
      6. Login as teacher. Make sure there's no student's record/activity.

      Show
      1. Login as teacher and add advanced upload assignment. 2. Login as student and go the assignment page 3. Upload a file to the system (without pressing the Save Changes button). 4. Click on any pages other than the current assignment page. 5. Click the assignment title again and the student will get the message "No files submitted yet". 6. Login as teacher. Make sure there's no student's record/activity.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      16595

      Description

      Hi there,

      I found two problem in assignment submission.
      A.) There is an "draft" entry (without any document shown, please refer to assignment_01.bmp) in the "View submitted Assignment" page if a student upload their assignment without press the Save Change button.
      Steps:
      1.) Login as teacher and add an online assignment.
      2.) Login as student and go the assignment page
      3.) Upload a file to the system (without pressing the Save Changes button).
      4.) Click on any pages other than the current assignment page.
      4.) Click the assignment title again and the student will get the message "No files submitted yet". The student can't find the submitted assignment.
      4.) Login as teacher. The teacher will note that a student uploaded his assignment but you can access it.

      Personally, I will suggest that system should automatically save the file in server once the student has uploaded the file to server.

      B.) There is an entry (please refer to assignment_02.bmp) in the "View submitted Assignment" page if a student press Save Changes button without uploading any files
      Steps:
      1.) Login as a student and go the assignment page.
      2.) Press the Save Changes button without uploading any files to the system
      3.) Login as a teacher and check the assignment submission records. Then, I found that the system will mark the submitted as succesfully. But, of course, I can't access to any files.

      It is a bug. I suggest that there should have a checking in the upload.php to disallow the student to press the Save Changes button if they haven't uploaded any files yet.

      Thanks.

      1. assignment_01.bmp
        478 kB
        Michelle Leung
      2. assignment_02.bmp
        540 kB
        Michelle Leung
      3. mypatch
        1 kB
        Nikhil Gupta
      4. mypatch
        2 kB
        Nikhil Gupta
      5. patch
        3 kB
        Nikhil Gupta
      6. patch
        3 kB
        Nikhil Gupta
      7. patch
        1 kB
        Nikhil Gupta
      1. screeshot1-bug.png
        23 kB

        Issue Links

          Activity

          Hide
          Nitin Agrawal added a comment -

          I too got the same problem Michelle that you had pointed out . I am working on it to fix it .

          Show
          Nitin Agrawal added a comment - I too got the same problem Michelle that you had pointed out . I am working on it to fix it .
          Hide
          Helen Foster added a comment - - edited

          Michelle, thanks for your report with clear steps to reproduce. (I guess you meant upload file assignment type and not online?)

          Nitin, thanks for testing and confirming the problem.

          Show
          Helen Foster added a comment - - edited Michelle, thanks for your report with clear steps to reproduce. (I guess you meant upload file assignment type and not online?) Nitin, thanks for testing and confirming the problem.
          Hide
          Nitin Agrawal added a comment -

          We can add a test whenever file upload dialog box gets closed and if test goes well , we could enable "Save change" button , otherwise keep it disabled such that user is not able to submit .

          Show
          Nitin Agrawal added a comment - We can add a test whenever file upload dialog box gets closed and if test goes well , we could enable "Save change" button , otherwise keep it disabled such that user is not able to submit .
          Hide
          Nikhil Gupta added a comment -

          hey i have fixed the problem and even prepared patch file for that..can anyone tell me where i suppose to submit that??

          Show
          Nikhil Gupta added a comment - hey i have fixed the problem and even prepared patch file for that..can anyone tell me where i suppose to submit that??
          Hide
          Nikhil Gupta added a comment -

          I am attaching a patch for this bug..I talked to the Dan Marsden and discussed about the bug how to fix that,so accordingly i did that and now i am attaching the patch for it

          Show
          Nikhil Gupta added a comment - I am attaching a patch for this bug..I talked to the Dan Marsden and discussed about the bug how to fix that,so accordingly i did that and now i am attaching the patch for it
          Hide
          Nikhil Gupta added a comment -

          I am attaching the patch file again,in previous file i have commented one thing by mistake,so i am attaching it once more,Ignore that file.Sorry for the incovenience.

          Show
          Nikhil Gupta added a comment - I am attaching the patch file again,in previous file i have commented one thing by mistake,so i am attaching it once more,Ignore that file.Sorry for the incovenience.
          Hide
          Michelle Leung added a comment -

          Nikhil,
          Thanks a lot for your help.
          We applied the patch to our server and found that the problem1 was fixed. But, the problem2 is still occurred. If you have any updates on problem2, please let me know and I will test it again. Many thanks.
          Michelle

          Show
          Michelle Leung added a comment - Nikhil, Thanks a lot for your help. We applied the patch to our server and found that the problem1 was fixed. But, the problem2 is still occurred. If you have any updates on problem2, please let me know and I will test it again. Many thanks. Michelle
          Hide
          Nikhil Gupta added a comment -

          Michelle,
          I have made the changes in such a way that user will not be able to click the "save button" until the file is uploaded on to it,so there will be no way that assignment submission would be recorded as the user is not able to click the "save button" before uploading the file.
          Can you elaborate me more whats the problem still coming??

          Show
          Nikhil Gupta added a comment - Michelle, I have made the changes in such a way that user will not be able to click the "save button" until the file is uploaded on to it,so there will be no way that assignment submission would be recorded as the user is not able to click the "save button" before uploading the file. Can you elaborate me more whats the problem still coming??
          Hide
          Aparup Banerjee added a comment -

          Hi Nikihil,
          Thanks for the patch.
          I had a glance at the patch, heres some feedback:
          1) it seems the file is renamed in the patch, that would break.
          2) theres a blank if block, why not use !=
          3) this change might affect other places, i'd try to take into account possible regressions (even if it seems unlikely).

          also have a look at http://docs.moodle.org/en/Development:Coding_style

          Show
          Aparup Banerjee added a comment - Hi Nikihil, Thanks for the patch. I had a glance at the patch, heres some feedback: 1) it seems the file is renamed in the patch, that would break. 2) theres a blank if block, why not use != 3) this change might affect other places, i'd try to take into account possible regressions (even if it seems unlikely). also have a look at http://docs.moodle.org/en/Development:Coding_style
          Hide
          Nikhil Gupta added a comment -

          Aparup,
          I have changed the patch according to the coding style given in the document.

          Show
          Nikhil Gupta added a comment - Aparup, I have changed the patch according to the coding style given in the document.
          Hide
          Richard Klein added a comment -

          Hi Nikhil,
          Thanks for your work on this. This is proving a very serious issue for the schools in which I run Moodle - many of their students end up not really submitting their files for assignments.

          While your patch seems to solve the problem for single file uploads, I think that I breaks 'advanced uploading of files' where users can upload more than one file. Strangely, in this situation, the button starts off enabled and as soon as the first file is uploaded the button is disabled.

          I can only guess that file_info_child is still being set to "[object Text]" when there is some kind of array of files - that's just a guess, my Javascript is fairly shaky.

          Also, if possible could there also be a check on the server side when save changes is actually run? Maybe an error that says "No Files Selected" or something similar might tighten things up? I find that on a slow internet line while the AJAX circle is still spinning, the button is enabled, which means that a user that is fast enough could still click save without files.

          This is a very serious issue for a number of schools in the area. If you point me in the right direction, I'm happy to do what I can to help resolve this quickly.
          Thanks,
          Richard

          Show
          Richard Klein added a comment - Hi Nikhil, Thanks for your work on this. This is proving a very serious issue for the schools in which I run Moodle - many of their students end up not really submitting their files for assignments. While your patch seems to solve the problem for single file uploads, I think that I breaks 'advanced uploading of files' where users can upload more than one file. Strangely, in this situation, the button starts off enabled and as soon as the first file is uploaded the button is disabled. I can only guess that file_info_child is still being set to " [object Text] " when there is some kind of array of files - that's just a guess, my Javascript is fairly shaky. Also, if possible could there also be a check on the server side when save changes is actually run? Maybe an error that says "No Files Selected" or something similar might tighten things up? I find that on a slow internet line while the AJAX circle is still spinning, the button is enabled, which means that a user that is fast enough could still click save without files. This is a very serious issue for a number of schools in the area. If you point me in the right direction, I'm happy to do what I can to help resolve this quickly. Thanks, Richard
          Hide
          Nikhil Gupta added a comment -

          Hi Richard,
          Yes , I did that for the single upload file,thanks for pointing out,i will try to check out the things and will let you know whenever the things are fixed.

          Show
          Nikhil Gupta added a comment - Hi Richard, Yes , I did that for the single upload file,thanks for pointing out,i will try to check out the things and will let you know whenever the things are fixed.
          Hide
          Nikhil Gupta added a comment -

          Hi Richard,
          I have made changes in the patch for the multiple file upload also,so now it can be used for multiple file upload also.
          Use the latest attached patch.

          Show
          Nikhil Gupta added a comment - Hi Richard, I have made changes in the patch for the multiple file upload also,so now it can be used for multiple file upload also. Use the latest attached patch.
          Hide
          Richard Klein added a comment -

          Hi Nikhil,

          This appears to solve the problem. Thanks very much for your help

          Show
          Richard Klein added a comment - Hi Nikhil, This appears to solve the problem. Thanks very much for your help
          Hide
          Michelle Leung added a comment -

          Hi Nikhil,

          Thanks a lot for your work on this issue. Your patch fixed most of the problem except for the case that when the student press Cancel button in Multiple file upload. Would you please help to check it and let me know if there is a new patch for test? Many thanks.

          Michelle.

          Show
          Michelle Leung added a comment - Hi Nikhil, Thanks a lot for your work on this issue. Your patch fixed most of the problem except for the case that when the student press Cancel button in Multiple file upload. Would you please help to check it and let me know if there is a new patch for test? Many thanks. Michelle.
          Hide
          Nikhil Gupta added a comment -

          Hi Michelle,

          I didnt find any problem with the cancel button in Multiple File Upload.Can you explain me little more whats the problem so that i can try to fix that.

          Show
          Nikhil Gupta added a comment - Hi Michelle, I didnt find any problem with the cancel button in Multiple File Upload.Can you explain me little more whats the problem so that i can try to fix that.
          Hide
          Michelle Leung added a comment -

          Hi Nikhil,

          Here are the steps that I did:
          1.) Login as a student and go the multiple assignment page.
          2.) Press the "Upload files" button.
          3.) Press the "Cancel" button.
          4.) Login as a teacher and check the assignment submission records. Then, I found that the system will mark the submitted as successful and without any file attached.

          Thanks for your help in advance.

          Show
          Michelle Leung added a comment - Hi Nikhil, Here are the steps that I did: 1.) Login as a student and go the multiple assignment page. 2.) Press the "Upload files" button. 3.) Press the "Cancel" button. 4.) Login as a teacher and check the assignment submission records. Then, I found that the system will mark the submitted as successful and without any file attached. Thanks for your help in advance.
          Hide
          Nikhil Gupta added a comment -

          Hi Michelle,
          I have corrected that problem,
          There was error in the coding,whenever multiple assignment page is refreshed(first time) then there is insertion of new record in the mdl_assignment_submission table in the database due to which it shows the blank file draft(even when the cancel button is pressed),I have made it correct and attaching a patch for it..

          Show
          Nikhil Gupta added a comment - Hi Michelle, I have corrected that problem, There was error in the coding,whenever multiple assignment page is refreshed(first time) then there is insertion of new record in the mdl_assignment_submission table in the database due to which it shows the blank file draft(even when the cancel button is pressed),I have made it correct and attaching a patch for it..
          Hide
          Richard Klein added a comment -

          Hi Nikhil,

          Unfortunately I've found another, quite serious problem. This patch breaks the functionality of forums.

          It appears when you post to a forum, Moodle uses the same form. So with the patch applied, it won't allow anyone to post to a forum unless they attach a file - ie. When posting a new message on the forum, the "Post to forum" button is greyed out until you attach a file.

          Is there any way to check the context in which the form is loaded and only grey the button sometimes?

          Thanks in advance,
          Richard

          Show
          Richard Klein added a comment - Hi Nikhil, Unfortunately I've found another, quite serious problem. This patch breaks the functionality of forums. It appears when you post to a forum, Moodle uses the same form. So with the patch applied, it won't allow anyone to post to a forum unless they attach a file - ie. When posting a new message on the forum, the "Post to forum" button is greyed out until you attach a file. Is there any way to check the context in which the form is loaded and only grey the button sometimes? Thanks in advance, Richard
          Hide
          Mira Vogel added a comment -

          Just to add to the requests for this empty submission issue to be addressed - students get very concerned about receipts and confirmation that they have submitted successfully, and currently the confirmation Moodle gives is potentially misleading since it indicates a successful submission whether or not a file has been uploaded.

          We can explain in our guidance, but that assumes people read the guidance. If they don't, this is the kind of thing that can undermine confidence and contribute to disputes, so I hope it can be fixed soon.

          Show
          Mira Vogel added a comment - Just to add to the requests for this empty submission issue to be addressed - students get very concerned about receipts and confirmation that they have submitted successfully, and currently the confirmation Moodle gives is potentially misleading since it indicates a successful submission whether or not a file has been uploaded. We can explain in our guidance, but that assumes people read the guidance. If they don't, this is the kind of thing that can undermine confidence and contribute to disputes, so I hope it can be fixed soon.
          Hide
          Tony Box added a comment -

          I would also like to express my concern with this critical bug. Mira put it well - it's very difficult to sell people on using Moodle when it can't be trusted to do what it's supposed to do. It looks like the activity on this issue has petered off and so I hope that a fix is still in the works.

          Show
          Tony Box added a comment - I would also like to express my concern with this critical bug. Mira put it well - it's very difficult to sell people on using Moodle when it can't be trusted to do what it's supposed to do. It looks like the activity on this issue has petered off and so I hope that a fix is still in the works.
          Hide
          Bob Ridge-Stearn added a comment -

          This is a serious problem. We have instances where students think they have uploaded an assignment but because they did not press the Save button their file was not uploaded. However, they have a date stamp that implies they did successfully upload.

          Show
          Bob Ridge-Stearn added a comment - This is a serious problem. We have instances where students think they have uploaded an assignment but because they did not press the Save button their file was not uploaded. However, they have a date stamp that implies they did successfully upload.
          Hide
          Christos Rodosthenous added a comment -

          This is really a problem. Most students make the same mistake and miss deadlines for submission. Is there an update regarding this issue?

          Show
          Christos Rodosthenous added a comment - This is really a problem. Most students make the same mistake and miss deadlines for submission. Is there an update regarding this issue?
          Hide
          Christos Rodosthenous added a comment - - edited

          The problem also occurs on the assignment activity page (where all assignments are listed). Most students check whether their assignment is submitted by checking this page and even when no file or assignment is still in draft, a submission date is shown misleading students thinking that their assignment is correctly submitted.

          I would suggest:
          1) No submission date (time stamp) is shown unless assignment is send for marking (When send for marking is on) and a file is uploaded (advanced uploading of files and single upload)

          This bug also affects moodle 2.1.1

          Show
          Christos Rodosthenous added a comment - - edited The problem also occurs on the assignment activity page (where all assignments are listed). Most students check whether their assignment is submitted by checking this page and even when no file or assignment is still in draft, a submission date is shown misleading students thinking that their assignment is correctly submitted. I would suggest: 1) No submission date (time stamp) is shown unless assignment is send for marking (When send for marking is on) and a file is uploaded (advanced uploading of files and single upload) This bug also affects moodle 2.1.1
          Hide
          Christos Rodosthenous added a comment -

          Any update on this issue?

          Show
          Christos Rodosthenous added a comment - Any update on this issue?
          Hide
          Mira Vogel added a comment - - edited

          This is a very serious problem compounded by the fact that the Course Overview block, which we enable as default on the My Home page because it's so helpful, also gives students false confirmation that they've submitted work when in fact they haven't uploaded any files.

          I'd suggest no submission date nor confirmation is displayed unless a submitted file is present.

          Show
          Mira Vogel added a comment - - edited This is a very serious problem compounded by the fact that the Course Overview block, which we enable as default on the My Home page because it's so helpful, also gives students false confirmation that they've submitted work when in fact they haven't uploaded any files. I'd suggest no submission date nor confirmation is displayed unless a submitted file is present.
          Hide
          Andrew Nicols added a comment -

          MDL-31315 looks to add a warning message on any form when a user moves away from it.

          This may be another string to the bow in preventing this kind of issue.

          Show
          Andrew Nicols added a comment - MDL-31315 looks to add a warning message on any form when a user moves away from it. This may be another string to the bow in preventing this kind of issue.
          Hide
          Andrew Nicols added a comment -

          MDL-29400 looks to address the issue of a timestamp being shown when no files were actually uploaded.

          Show
          Andrew Nicols added a comment - MDL-29400 looks to address the issue of a timestamp being shown when no files were actually uploaded.
          Hide
          Michael de Raadt added a comment -

          Yes, MDL-29400 is a half-step towards fixing this issue, but the issue of creating an entry in the submissions table before a file is uploaded still remains.

          Show
          Michael de Raadt added a comment - Yes, MDL-29400 is a half-step towards fixing this issue, but the issue of creating an entry in the submissions table before a file is uploaded still remains.
          Hide
          Dan Poltawski added a comment -

          Hi Michael I disagree. We have too many different issues tied up in this bug. I think most people interested in this bug will find their issue resolved.

          People interested in this bug - please can you test the weekly release which will be available from the weekend and report back if your issue has been resolved?

          There is an issue remaining that a draft record is created when a student attempts to upload a file (but doesn't). A submission record is_not created, a draft record is. This distinction is important. I think this should be a seperate bug as I don't believe its the same issue that most people voting for this issue are interested in.

          Show
          Dan Poltawski added a comment - Hi Michael I disagree. We have too many different issues tied up in this bug. I think most people interested in this bug will find their issue resolved. People interested in this bug - please can you test the weekly release which will be available from the weekend and report back if your issue has been resolved? There is an issue remaining that a draft record is created when a student attempts to upload a file (but doesn't). A submission record is_not created, a draft record is. This distinction is important. I think this should be a seperate bug as I don't believe its the same issue that most people voting for this issue are interested in.
          Hide
          Michael de Raadt added a comment -

          Hi, Dan.

          I don't think there is anything to disagree about. A record in the submissions table is still being created, regardless of what it is called. And when this record is created, a submission appears on the submissions page. I think that is a significant part of this issue according to the original report.

          You are correct that there are two problems reported in this one issue, which is one too many. It's also the case that this problem has been reported too many times in slightly different ways.

          MDL-31545 may resolve this problem. If we're happy with the solution to that problem, we can close both of these issues.

          Show
          Michael de Raadt added a comment - Hi, Dan. I don't think there is anything to disagree about. A record in the submissions table is still being created, regardless of what it is called. And when this record is created, a submission appears on the submissions page. I think that is a significant part of this issue according to the original report. You are correct that there are two problems reported in this one issue, which is one too many. It's also the case that this problem has been reported too many times in slightly different ways. MDL-31545 may resolve this problem. If we're happy with the solution to that problem, we can close both of these issues.
          Hide
          Rossiani Wijaya added a comment -

          Hi guys,

          Thank you Nikhil for providing patch for the issue.

          I tested this issue on 2.2 stable and confirmed that part B of this issue is fixed through MDL-31545.

          As for part A, it still remains an issue. Nikhil's patch provide a fix solution through JS, but it's not quite working for me (or maybe I'm missing something here or the JS file has been modified tremendously since then).

          However I have created a patch to fix the submission instance instead.

          Show
          Rossiani Wijaya added a comment - Hi guys, Thank you Nikhil for providing patch for the issue. I tested this issue on 2.2 stable and confirmed that part B of this issue is fixed through MDL-31545 . As for part A, it still remains an issue. Nikhil's patch provide a fix solution through JS, but it's not quite working for me (or maybe I'm missing something here or the JS file has been modified tremendously since then). However I have created a patch to fix the submission instance instead.
          Hide
          Rossiani Wijaya added a comment -

          ps: the patch is still in working progress stage. It still needs further testing.

          Show
          Rossiani Wijaya added a comment - ps: the patch is still in working progress stage. It still needs further testing.
          Hide
          Ankit Agarwal added a comment -

          Hi Rosie,
          Looks good to me.

          Thanks

          Show
          Ankit Agarwal added a comment - Hi Rosie, Looks good to me. Thanks
          Hide
          Aparup Banerjee added a comment -

          Hi Rosie,
          i've added a commit to clarify the phpdoc and fix up whitespace.

          so i think this looks fine for part B.

          this is integrated now into master, 23 and 22. Test away!

          ps: issues like this - this was why the new mod_assign came into picture me thinks.

          Show
          Aparup Banerjee added a comment - Hi Rosie, i've added a commit to clarify the phpdoc and fix up whitespace. so i think this looks fine for part B. this is integrated now into master, 23 and 22. Test away! ps: issues like this - this was why the new mod_assign came into picture me thinks.
          Hide
          Tim Barker added a comment -

          Congrats your test passed.

          Show
          Tim Barker added a comment - Congrats your test passed.
          Hide
          Aparup Banerjee added a comment -

          yay, it works!

          This issue has been put through rigorous processes and finally swam upstream along with some 65 others this week.

          Thank you all for taking the time to get us here.

          cheers!

          Show
          Aparup Banerjee added a comment - yay, it works! This issue has been put through rigorous processes and finally swam upstream along with some 65 others this week. Thank you all for taking the time to get us here. cheers!
          Hide
          Nikhil Gupta added a comment -

          Hi,
          That's great it finally worked.
          I was not in the touch ,so was not able to look onto it.

          Show
          Nikhil Gupta added a comment - Hi, That's great it finally worked. I was not in the touch ,so was not able to look onto it.
          Hide
          Willian Mano Araujo added a comment -

          Great Job.

          but... works for me only in google chrome. Firefox and i.e doesn't work. =/

          Show
          Willian Mano Araujo added a comment - Great Job. but... works for me only in google chrome. Firefox and i.e doesn't work. =/
          Hide
          Aparup Banerjee added a comment -

          Hi Willian,
          this issue was closed a while ago, please create a separate report for it to be worked on and provide more details or screenshots about the issue there.

          Show
          Aparup Banerjee added a comment - Hi Willian, this issue was closed a while ago, please create a separate report for it to be worked on and provide more details or screenshots about the issue there.

            People

            • Votes:
              29 Vote for this issue
              Watchers:
              25 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: