Unintuitive navigation in Problem Editor if a .tmp version exists

未关闭
#2,782 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
perl
领域
full-stack

调研方向

Reproduce it in the Problem Editor: open an existing .pg file, edit it without saving, then reopen the same file and note that the .tmp copy loads instead. Also try choosing a sample problem after a .tmp exists. The issue proposes two fixes (block edits to sample and blank problems until saved under a new name, or ask the user to choose between the .tmp and original on load) but does not pick one, so agree on the behaviour with maintainers first. Done when the chosen behaviour is implemented and covered by a test.

由索引模型根据 Issue 内容生成。

描述

If there is a .tmp version of a .pg file, then the Problem Editor always loads that instead of the actual file that the user requested. I run into two issues with this:

  1. If I'm editing a .pg file I often miss the message at the top telling me that there are unsaved changes, and end up building new changes on top of experimental stuff that I never intended to keep.
  2. In 2.20 when you click on the Problem Editor you are asked to choose between a new problem template, an existing file, or a sample problem. If I choose the first or third option then I expect to get what I asked for (i.e. a blank problem or a sample problem), but if there is a .tmp version, then I'm not actually getting a sample problem. Instead I'm getting my previous edits of the sample problem. There is still the message at the top about unsaved changes, but it isn't what I asked for.

I'm not sure how to make this more intuitive.

For the second issue one option is to not allow edits of sample problems and blank problems until a copy with a new name has been saved, which would mean that there would never be a .tmp version for the Problem Editor to find. This would guarantee that you always get the true blank/sample problem that you asked for.

A different approach is to make the user decide whether to use the edited version or the original as soon as the problem is loaded into the editor. i.e. if a .tmp version of the requested file exists, then send the user to a screen that says "There are unsaved changes to this problem file", and then makes them explicitly choose whether to revert the changes and edit the original, or continue from the unsaved changes.

主要语言
Perl
星标
164
派生
167
平均合并
6 天 7 小时
30 天内合并 PR
27

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

openwebwork/webwork2 的其他 Issue

查看 openwebwork/webwork2 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。