Commit 40dd5d5
committed
Rework error handling when a problem fails to render in a test.
First, fix a general issue when a problem fails to render that results
in a message that has no relation to the actual problem. The issue is
that the `create_ans_str_from_responses` method of the
`WeBWorK::Utils::ProblemProcessing` module is called with a `$pg` hash
that doesn't contain the right things, and the method is not safe
guarded against that. This fixes issue #2829.
Second, rework how error handling is done in tests. Instead of just
rendering the errors for problems that failed to render, still render
all problems on the page. Show the errors for the problems that failed,
but still render all of the problems that didn't fail. This means, that
the problem navigation is still shown. In fact the entire page renders
normally, but the error message is shown for the problems that fail to
render. So the student can at least continue to work the rest of the
test normally. The student can even grade the test on a page for which
a problem fails to render.
Note that the "request information" is no longer shown for these
messages when in a test. A special `briefErrorOutput` stash value can
be set when the `templates/ContentGenerator/Base/error_output.html.ep`
template is rendered to skip that. Although, I really thing that
information should never be shown in the page for any exception that
occurs. I don't think that the time, method, uri, and HTTP headers of
the request, ever help with these exceptions.1 parent a00a004 commit 40dd5d5
File tree
6 files changed
+26
-46
lines changed- lib/WeBWorK
- ContentGenerator
- Utils
- templates/ContentGenerator
- Base
6 files changed
+26
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
887 | 887 | | |
888 | 888 | | |
889 | 889 | | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | 890 | | |
894 | 891 | | |
895 | 892 | | |
| |||
1511 | 1508 | | |
1512 | 1509 | | |
1513 | 1510 | | |
1514 | | - | |
1515 | | - | |
1516 | | - | |
1517 | | - | |
1518 | | - | |
1519 | | - | |
1520 | | - | |
1521 | | - | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | 1511 | | |
1526 | 1512 | | |
1527 | 1513 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1549 | 1549 | | |
1550 | 1550 | | |
1551 | 1551 | | |
1552 | | - | |
| 1552 | + | |
1553 | 1553 | | |
1554 | 1554 | | |
1555 | 1555 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | | - | |
| 329 | + | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | 111 | | |
131 | 112 | | |
132 | 113 | | |
| |||
405 | 386 | | |
406 | 387 | | |
407 | 388 | | |
408 | | - | |
| 389 | + | |
409 | 390 | | |
410 | 391 | | |
411 | 392 | | |
| |||
603 | 584 | | |
604 | 585 | | |
605 | 586 | | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
611 | 602 | | |
612 | 603 | | |
613 | 604 | | |
| |||
651 | 642 | | |
652 | 643 | | |
653 | 644 | | |
654 | | - | |
| 645 | + | |
655 | 646 | | |
656 | 647 | | |
657 | 648 | | |
| |||
785 | 776 | | |
786 | 777 | | |
787 | 778 | | |
788 | | - | |
| 779 | + | |
789 | 780 | | |
0 commit comments