Commit 403aebd
committed
Improvements for the "Save As" form in the PG editor.
In general when editing any kind of problem the option to "Append to end
of set" is now shown. Even for a new problem template or a sample
problem. Furthermore, the option includes a select with which to choose
a set for the course. When editing a problem that is in a set, the set
the problem is in is selected by default. Otherwise, the default "Select
a Set" option is selected. When the form is submitted and this option is
selected, then validation occurs to ensure that a set has been chosen.
Also, server side the parameter is validated. Note that if the server
receives a request that has the radio selected but a target set is not
in the parameters, then the file will be saved, but it will not be added
to any set. However, this generally will not happen for those using the
problem editor. It will only happen for someone that is properly
authenticated and with sufficient permissions, that is hacking on
parameters.
Wnen editing a course info file, set header file, or hardcopy header
file, do not show the "Copy auxiliary files" option. That option should
only ever be shown for problem files.
When editing a set or hardcopy header, don't show the options to
"Replace current problem", "Append to end of set", or "Create unattached
problem". Those don't make sense at all for a header file. They are not
problems. Instead show options to "Set as set header for set" or
"Create unattached header file". The option to "Set as set header for
set" also includes a select with which to choose a set for the course
that the file will be set as the header for. The set that the file is a
set header for is selected by default.
When a default set or hardcopy header is being edited don't include
`opt/webwork/webwork2/pg` in the default save to file name that is
shown.
When a sample problem is being edited, use the original file name of the
sample problem for the default file name to save the file to. This can
still be changed by the author, but it doesn't need to be
"newProblem.pg" for these.
Note that the message that states that "You can change the file path for
this problem manually from the Sets Manager page" when the file that is
being saved already exists has been removed. That message has been
there for a long time, but it doesn't really make sense to state it at
this point. The user has chosen a file name, not knowing that a file by
that name already exists. The intent was not to use the existing file
for the problem. The intent was to save the current content as the
chosen file name and use it for the problem. In addition, this message
was shown for any file type, and does not apply to set headers at all.
IMPORTANT NOTE: The problem editor no longer attempts to use a set
version and nothing should try to open it with a set version. The only
case where that was done has been removed. That is from the set detail
page when editing a set version for a user. Now on that page, that only
sends the set without the version. The reason this was done is because
doing so in many cases results in an exception being thrown when you try
to save or do many of the things in the problem editor. Even when saving
doesn't result in an exception, the save doesn't go where you might
think it would go. Also, don't try to use the effective user anywhere
in the problem editor. That also does not do what you might think.
Generally, these were things that were not really thought out. You
really shouldn't be editing a problem for a particular user or set
version. So the problem editor never tries to change the source file for
a user problem. It always works with the global problem.
Also there are a few minor changes to a couple of other tabs. These are
below.
Don't show the "Convert the code to PGML" and "Analyze code with PG
Critic" options on the "Code Maintenance" tab when editing a set header.
A set header might have antiquated methods such as BEGIN_TEXT/END_TEXT
blocks, but I don't think that it is a very good idea to try the PGML
conversion on these. Although the PG critic will work on these files,
there are many things that the PG critic will report that don't apply at
all to set headers, such as having metadata or a needing solution. Not
showing "Convert the code to PGML" is perhaps debatable, but not showing
"Analyze code with PG Critic" is really not debatable.
On the "View/Reload" and "Generate Hardcopy" tabs do not show the
options to change the seed when editing a set header. The seed doesn't
really apply to set headers. I don't think a set header should ever use
the random methods.
Note that the primary intent of this pull request is to address issue #2992.1 parent bc13c21 commit 403aebd
10 files changed
Lines changed: 298 additions & 238 deletions
File tree
- htdocs/js/PGProblemEditor
- lib/WeBWorK/ContentGenerator/Instructor
- templates/ContentGenerator/Instructor
- PGProblemEditor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
383 | 417 | | |
384 | 418 | | |
385 | 419 | | |
| |||
Lines changed: 125 additions & 126 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | 148 | | |
156 | 149 | | |
157 | 150 | | |
158 | 151 | | |
159 | 152 | | |
160 | 153 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | 154 | | |
169 | 155 | | |
170 | 156 | | |
| |||
239 | 225 | | |
240 | 226 | | |
241 | 227 | | |
242 | | - | |
| 228 | + | |
243 | 229 | | |
244 | 230 | | |
245 | 231 | | |
| |||
341 | 327 | | |
342 | 328 | | |
343 | 329 | | |
| 330 | + | |
| 331 | + | |
344 | 332 | | |
345 | 333 | | |
346 | 334 | | |
| |||
523 | 511 | | |
524 | 512 | | |
525 | 513 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
535 | 519 | | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
| 520 | + | |
542 | 521 | | |
543 | 522 | | |
544 | | - | |
545 | | - | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
546 | 529 | | |
547 | 530 | | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
556 | 536 | | |
557 | 537 | | |
558 | 538 | | |
| |||
866 | 846 | | |
867 | 847 | | |
868 | 848 | | |
| 849 | + | |
869 | 850 | | |
870 | 851 | | |
871 | 852 | | |
| |||
1131 | 1112 | | |
1132 | 1113 | | |
1133 | 1114 | | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
1137 | 1115 | | |
1138 | 1116 | | |
1139 | 1117 | | |
1140 | 1118 | | |
1141 | 1119 | | |
1142 | 1120 | | |
1143 | 1121 | | |
1144 | | - | |
1145 | 1122 | | |
1146 | | - | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1147 | 1129 | | |
1148 | 1130 | | |
1149 | 1131 | | |
| |||
1155 | 1137 | | |
1156 | 1138 | | |
1157 | 1139 | | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
1178 | | - | |
1179 | | - | |
1180 | | - | |
1181 | | - | |
1182 | | - | |
1183 | | - | |
1184 | | - | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1185 | 1150 | | |
1186 | | - | |
1187 | | - | |
1188 | | - | |
1189 | | - | |
1190 | | - | |
1191 | | - | |
1192 | | - | |
1193 | | - | |
1194 | | - | |
1195 | | - | |
1196 | | - | |
1197 | | - | |
1198 | | - | |
1199 | | - | |
1200 | | - | |
1201 | | - | |
1202 | | - | |
1203 | | - | |
1204 | | - | |
1205 | | - | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
1210 | 1188 | | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
1211 | 1199 | | |
1212 | 1200 | | |
1213 | | - | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
1214 | 1215 | | |
1215 | | - | |
1216 | | - | |
1217 | | - | |
1218 | | - | |
1219 | | - | |
1220 | | - | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
1221 | 1233 | | |
1222 | | - | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
1223 | 1240 | | |
1224 | | - | |
1225 | | - | |
1226 | | - | |
1227 | | - | |
1228 | | - | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
1240 | | - | |
1241 | | - | |
1242 | | - | |
| 1241 | + | |
1243 | 1242 | | |
1244 | 1243 | | |
1245 | 1244 | | |
| |||
1260 | 1259 | | |
1261 | 1260 | | |
1262 | 1261 | | |
1263 | | - | |
| 1262 | + | |
1264 | 1263 | | |
1265 | 1264 | | |
1266 | | - | |
| 1265 | + | |
1267 | 1266 | | |
1268 | 1267 | | |
1269 | 1268 | | |
1270 | 1269 | | |
1271 | | - | |
| 1270 | + | |
1272 | 1271 | | |
1273 | 1272 | | |
1274 | 1273 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1298 | 1298 | | |
1299 | 1299 | | |
1300 | 1300 | | |
1301 | | - | |
1302 | 1301 | | |
1303 | 1302 | | |
1304 | 1303 | | |
| |||
0 commit comments