|
62 | 62 | let interactorSecretEditing = $state(false); |
63 | 63 | </script> |
64 | 64 |
|
65 | | -{#if status === "CE"} |
66 | | - <div class="testcase-container"> |
67 | | - <TestcaseToolbar {id} {testcase} {onprerun} /> |
68 | | - </div> |
69 | | -{:else if status === "NA" || status === "AC" || status === "WA" || status === "RE" || status === "TL" || status === "ML"} |
| 65 | +{#if status === "NA" || status === "AC" || status === "WA" || status === "RE" || status === "TL" || status === "ML" || status === "CE"} |
70 | 66 | <div class="testcase-container"> |
71 | 67 | <TestcaseToolbar {id} {testcase} {onprerun} /> |
72 | 68 | {#if showDetails} |
|
90 | 86 | }} |
91 | 87 | /> |
92 | 88 | {/if} |
93 | | - <AutoresizeTextarea |
94 | | - bind:value={testcase.stdin} |
95 | | - bind:editing={stdinEditing} |
96 | | - placeholder="Input..." |
97 | | - readonly={testcase.mode === "interactive"} |
98 | | - onexpand={() => handleExpandStdio("STDIN")} |
99 | | - onpreedit={() => { |
100 | | - postProviderMessage({ type: "REQUEST_FULL_DATA", id, stdio: "STDIN" }); |
101 | | - }} |
102 | | - onsave={handleSaveStdin} |
103 | | - oncancel={() => { |
104 | | - postProviderMessage({ type: "REQUEST_TRIMMED_DATA", id, stdio: "STDIN" }); |
105 | | - }} |
106 | | - /> |
107 | | - <AutoresizeTextarea |
108 | | - value={testcase.stderr} |
109 | | - readonly |
110 | | - hiddenOnEmpty |
111 | | - variant="stderr" |
112 | | - onexpand={() => handleExpandStdio("STDERR")} |
113 | | - /> |
114 | | - {#if testcase.mode === "interactive" || testcase.status !== "AC"} |
115 | | - <AutoresizeTextarea |
116 | | - value={testcase.stdout} |
117 | | - readonly |
118 | | - hiddenOnEmpty |
119 | | - onexpand={() => handleExpandStdio("STDOUT")} |
120 | | - > |
121 | | - {#snippet actions()} |
122 | | - {#if (status === "NA" || status === "WA") && testcase.mode !== "interactive"} |
123 | | - <button |
124 | | - class="action-button action-button--always-visible codicon codicon-pass" |
125 | | - data-tooltip="Accept Output" |
126 | | - aria-label="Accept" |
127 | | - onclick={() => postProviderMessage({ type: "ACTION", id, action: "ACCEPT" })} |
128 | | - ></button> |
129 | | - {/if} |
130 | | - {#if status === "WA" && testcase.mode !== "interactive"} |
131 | | - <button |
132 | | - class="action-button action-button--always-visible codicon codicon-diff-single" |
133 | | - data-tooltip="Compare Answers" |
134 | | - aria-label="Compare" |
135 | | - onclick={() => postProviderMessage({ type: "ACTION", id, action: "COMPARE" })} |
136 | | - ></button> |
137 | | - {/if} |
138 | | - {/snippet} |
139 | | - </AutoresizeTextarea> |
140 | | - {/if} |
141 | | - {#if testcase.mode !== "interactive"} |
| 89 | + {#if status !== "CE"} |
142 | 90 | <AutoresizeTextarea |
143 | | - bind:value={testcase.acceptedStdout} |
144 | | - bind:editing={acceptedStdoutEditing} |
145 | | - placeholder="Accepted output..." |
146 | | - variant="accepted" |
147 | | - onexpand={() => handleExpandStdio("ACCEPTED_STDOUT")} |
| 91 | + bind:value={testcase.stdin} |
| 92 | + bind:editing={stdinEditing} |
| 93 | + placeholder="Input..." |
| 94 | + readonly={testcase.mode === "interactive"} |
| 95 | + onexpand={() => handleExpandStdio("STDIN")} |
148 | 96 | onpreedit={() => { |
149 | | - postProviderMessage({ type: "REQUEST_FULL_DATA", id, stdio: "ACCEPTED_STDOUT" }); |
| 97 | + postProviderMessage({ type: "REQUEST_FULL_DATA", id, stdio: "STDIN" }); |
150 | 98 | }} |
151 | | - onsave={handleSaveAcceptedStdout} |
| 99 | + onsave={handleSaveStdin} |
152 | 100 | oncancel={() => { |
153 | | - postProviderMessage({ |
154 | | - type: "REQUEST_TRIMMED_DATA", |
155 | | - id, |
156 | | - stdio: "ACCEPTED_STDOUT", |
157 | | - }); |
| 101 | + postProviderMessage({ type: "REQUEST_TRIMMED_DATA", id, stdio: "STDIN" }); |
158 | 102 | }} |
159 | | - > |
160 | | - {#snippet actions()} |
161 | | - {#if status === "AC" && testcase.mode !== "interactive"} |
162 | | - <button |
163 | | - class="action-button action-button--always-visible codicon codicon-close" |
164 | | - data-tooltip="Decline Answer" |
165 | | - aria-label="Decline" |
166 | | - onclick={() => postProviderMessage({ type: "ACTION", id, action: "DECLINE" })} |
167 | | - ></button> |
168 | | - {/if} |
169 | | - {/snippet} |
170 | | - </AutoresizeTextarea> |
| 103 | + /> |
| 104 | + <AutoresizeTextarea |
| 105 | + value={testcase.stderr} |
| 106 | + readonly |
| 107 | + hiddenOnEmpty |
| 108 | + variant="stderr" |
| 109 | + onexpand={() => handleExpandStdio("STDERR")} |
| 110 | + /> |
| 111 | + {#if testcase.mode === "interactive" || testcase.status !== "AC"} |
| 112 | + <AutoresizeTextarea |
| 113 | + value={testcase.stdout} |
| 114 | + readonly |
| 115 | + hiddenOnEmpty |
| 116 | + onexpand={() => handleExpandStdio("STDOUT")} |
| 117 | + > |
| 118 | + {#snippet actions()} |
| 119 | + {#if (status === "NA" || status === "WA") && testcase.mode !== "interactive"} |
| 120 | + <button |
| 121 | + class="action-button action-button--always-visible codicon codicon-pass" |
| 122 | + data-tooltip="Accept Output" |
| 123 | + aria-label="Accept" |
| 124 | + onclick={() => postProviderMessage({ type: "ACTION", id, action: "ACCEPT" })} |
| 125 | + ></button> |
| 126 | + {/if} |
| 127 | + {#if status === "WA" && testcase.mode !== "interactive"} |
| 128 | + <button |
| 129 | + class="action-button action-button--always-visible codicon codicon-diff-single" |
| 130 | + data-tooltip="Compare Answers" |
| 131 | + aria-label="Compare" |
| 132 | + onclick={() => postProviderMessage({ type: "ACTION", id, action: "COMPARE" })} |
| 133 | + ></button> |
| 134 | + {/if} |
| 135 | + {/snippet} |
| 136 | + </AutoresizeTextarea> |
| 137 | + {/if} |
| 138 | + {#if testcase.mode !== "interactive"} |
| 139 | + <AutoresizeTextarea |
| 140 | + bind:value={testcase.acceptedStdout} |
| 141 | + bind:editing={acceptedStdoutEditing} |
| 142 | + placeholder="Accepted output..." |
| 143 | + variant="accepted" |
| 144 | + onexpand={() => handleExpandStdio("ACCEPTED_STDOUT")} |
| 145 | + onpreedit={() => { |
| 146 | + postProviderMessage({ type: "REQUEST_FULL_DATA", id, stdio: "ACCEPTED_STDOUT" }); |
| 147 | + }} |
| 148 | + onsave={handleSaveAcceptedStdout} |
| 149 | + oncancel={() => { |
| 150 | + postProviderMessage({ |
| 151 | + type: "REQUEST_TRIMMED_DATA", |
| 152 | + id, |
| 153 | + stdio: "ACCEPTED_STDOUT", |
| 154 | + }); |
| 155 | + }} |
| 156 | + > |
| 157 | + {#snippet actions()} |
| 158 | + {#if status === "AC" && testcase.mode !== "interactive"} |
| 159 | + <button |
| 160 | + class="action-button action-button--always-visible codicon codicon-close" |
| 161 | + data-tooltip="Decline Answer" |
| 162 | + aria-label="Decline" |
| 163 | + onclick={() => postProviderMessage({ type: "ACTION", id, action: "DECLINE" })} |
| 164 | + ></button> |
| 165 | + {/if} |
| 166 | + {/snippet} |
| 167 | + </AutoresizeTextarea> |
| 168 | + {/if} |
171 | 169 | {/if} |
172 | 170 | {/if} |
173 | 171 | </div> |
|
0 commit comments