Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-4781

Allow editing assignment submission text in offline

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.5.0
    • Assignment add-on
    • Hide

      This issue only needs to be tested in 1 device.

      1. In web as teacher, create 1 assign with "Online text" enabled in "Submission types".
      2. In web as student, add a new submission and include:
        1. Some MathJax content, I used MathJax like (a \ne 0) or $$ax^2 + bx + c = 0$$.
        2. An image uploaded to Moodle using the Moodle's file picker
      3. In the app, open the assign while being online but don't go to edit the submission page yet.
      4. Go offline and click to edit the submission. Check that:
        1. No error is shown.
        2. You can view the image in the editor (it's not a broken image).
        3. MathJax is being edited properly. To check this, you should click to view the source code in the editor and check the content does NOT include: <span class="filter_mathjaxloader_equation">.
      5. Make any change and save changes. Check that you see the content changed in the page to view the submission. Check that you see the image (it's not a broken image). Please notice that MathJax won't be displayed properly, it will display the original text because it hasn't been treated by the server yet.
      6. Go online and synchronize the data. Check that the data is successfully sent and you can see the new content (MathJax will be rendered now).
      7. Now delete all data in Site preferences > Manage downloads.
      8. Open the course that contains the assign (but not the assign), go to Course downloads and download the assign.
      9. Go offline, open the assign and click Edit submission. Check that no error is displayed and the content is loaded properly in the editor. This step is to check that prefetch downloads the needed data, there's no need to check again that saving data works fine.

      To be tested by a developer

      This part requires inspecting network requests so it should be done by a developer, it doesn't matter the device (it can be done in webapp too).

      1. In web as teacher, create 2 assigns: one with "Online text" enabled in "Submission types", and another one with "Online text" disabled.
      2. In the app as student, inspect Network requests and open the assign with online text. Check that you see 2 requests to mod_assign_get_submission_status with moodlewssettingfilter=true and there's no request with moodlewssettingfilter=false. The WS is called twice because the first time it doesn't return the submission data, it needs to be initialized first.
      3. Click to add a submission. Check that you see a request to mod_assign_get_submission_status with moodlewssettingfilter=true and there's no request with moodlewssettingfilter=false.
      4. Enter any data and save changes. Check that you see a request to mod_assign_get_submission_status with moodlewssettingfilter=true and also a request with moodlewssettingfilter=false (now there's data to edit so we need the unfiltered data too).
      5. Repeat the steps with the assign with no "Online text" and check that in all cases there isn't a request with moodlewssettingfilter=false (we don't need unfiltered data when editing files).
      6. Now login as teacher in the app, open the assign with Online text, go to Participants and open the submission of the student used in previous steps. Check that there's no request with moodlewssettingfilter=false.
      Show
      This issue only needs to be tested in 1 device. In web as teacher, create 1 assign with "Online text" enabled in "Submission types". In web as student, add a new submission and include: Some MathJax content, I used MathJax like (a \ne 0) or $$ax^2 + bx + c = 0$$. An image  uploaded to Moodle using the Moodle's file picker .  In the app, open the assign while being online but don't go to edit the submission page yet. Go offline and click to edit the submission. Check that: No error is shown. You can view the image in the editor (it's not a broken image). MathJax is being edited properly. To check this, you should click to view the source code in the editor and check the content does NOT include: <span class="filter_mathjaxloader_equation"> . Make any change and save changes. Check that you see the content changed in the page to view the submission. Check that you see the image (it's not a broken image). Please notice that MathJax won't be displayed properly, it will display the original text because it hasn't been treated by the server yet. Go online and synchronize the data. Check that the data is successfully sent and you can see the new content (MathJax will be rendered now). Now delete all data in Site preferences > Manage downloads. Open the course that contains the assign (but not the assign), go to Course downloads and download the assign. Go offline, open the assign and click Edit submission. Check that no error is displayed and the content is loaded properly in the editor. This step is to check that prefetch downloads the needed data, there's no need to check again that saving data works fine. To be tested by a developer This part requires inspecting network requests so it should be done by a developer, it doesn't matter the device (it can be done in webapp too). In web as teacher, create 2 assigns: one with "Online text" enabled in "Submission types", and another one with "Online text" disabled. In the app as student, inspect Network requests and open the assign with online text. Check that you see 2 requests to mod_assign_get_submission_status with moodlewssettingfilter=true and there's no request with moodlewssettingfilter=false . The WS is called twice because the first time it doesn't return the submission data, it needs to be initialized first. Click to add a submission. Check that you see a request to mod_assign_get_submission_status with moodlewssettingfilter=true and there's no request with moodlewssettingfilter=false . Enter any data and save changes. Check that you see a request to mod_assign_get_submission_status with moodlewssettingfilter=true and also a request with moodlewssettingfilter=false (now there's data to edit so we need the unfiltered data too). Repeat the steps with the assign with no "Online text" and check that in all cases there isn't a request with moodlewssettingfilter=false (we don't need unfiltered data when editing files). Now login as teacher in the app, open the assign with Online text, go to Participants and open the submission of the student used in previous steps. Check that there's no request with moodlewssettingfilter=false .
    • MOODLE_405_STABLE
    • Moodle Apps Sprint 2025-I1.4

      Because of filters, when we implemented the assignment activity in the app we decided to not allow editing submission text in offline. You can add new submissions in offline, but to edit an existing one with text the student needs to be online so the app can fetch the content unfiltered.

      In MOBILE-4647 we improved how filters are handled in some activities, and in the workshop activity we implemented so it supports offline for students and at the same time we handle filters properly.

      We can do the same for assign: every time the submission text is obtained with filters applied, we can also fetch it unfiltered to have it cached and allow editing it offline.

            dpalou Dani Palou
            dpalou Dani Palou
            Pau Ferrer Pau Ferrer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 3 hours, 12 minutes
                3d 3h 12m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.