teammates icon indicating copy to clipboard operation
teammates copied to clipboard

Warning message for potentially destructive edits of questions not shown under specific conditions

Open samuelfangjw opened this issue 2 years ago • 1 comments

  • Environment: v8.16.1

Steps to reproduce

  1. Open the edit session page of an open session as instructor. The session currently has no responses.
  2. Student responds to feedback question and submits their response.
  3. Instructor makes a destructive edit (without refreshing the edit page). For example, changing visibility, or changing options of mcq question.

Expected behaviour Modal with warnings should still be shown

Actual behaviour Responses are deleted without any warning

Additional info Warnings are skipped because of an additional check for whether there are any existing responses. https://github.com/TEAMMATES/teammates/blob/2fc791c1befbd1ed529556416c827171452ce593/src/web/app/components/question-edit-form/question-edit-form.component.ts#L284 However, isQuestionHasResponses is not updated between the time the instructor first loads the page and the time when the edited question is saved.

While this is unlikely, it is not implausible. For example, imagine an instructor who does not have the habit of closing tabs. He is informed of a minor typo in MCQ question at the start of the session, and proceeds to correct it resulting in the above situation (past responses being deleted silently).

Suggestion Add stricter checks for whether a session is already opened (there might be potential responses). If not possible, I believe the benefit of removing this check (potential silent deletion of responses) outweighs any potential minor annoyance to instructors.

samuelfangjw avatar Jun 05 '22 18:06 samuelfangjw

Add stricter checks for whether a session is already opened (there might be potential responses). If not possible, I believe the benefit of removing this check (potential silent deletion of responses) outweighs any potential minor annoyance to instructors.

Yes, good to do if the cost is low, but OK to leave as is if not.

damithc avatar Jun 06 '22 03:06 damithc

hi, I would like to attempt to take on this issue, thanks!

cedricongjh avatar Jan 18 '23 08:01 cedricongjh

hi, I would like to attempt to take on this issue, thanks!

Sure, you're welcome to try!

samuelfangjw avatar Jan 18 '23 08:01 samuelfangjw