|
78 | 78 | </div></div>
|
79 | 79 | % if test['display-output']:
|
80 | 80 | <div class="row">
|
| 81 | +<% |
| 82 | +s_stdout = test['execution-status']['output']['stdout'] |
| 83 | +s_userout = test['execution-status']['user-code']['stdout'] |
| 84 | +s_stdin = test['execution-status']['input']['stdout'] |
| 85 | +l_sout = s_stdout.split('\n') |
| 86 | +l_uout = s_userout.split('\n') |
| 87 | +l_sin = s_stdin.split('\n') |
| 88 | +n_out = [] |
| 89 | +n_sout = [] |
| 90 | +n_sin = [] |
| 91 | +def make_line_count(i, ps_arr=None): |
| 92 | + maxlen = len(str(max(len(l_sout), len(l_uout)))) |
| 93 | + if ps_arr: |
| 94 | + maxlen = len(str(len(ps_arr))) |
| 95 | + s = str(i).rjust(maxlen, ' ') |
| 96 | + return s |
| 97 | +for i in range(0, len(l_uout)): |
| 98 | + if i >= len(l_sout): |
| 99 | + n_out.append(make_line_count(i) + ' | ' + l_uout[i]) |
| 100 | + continue |
| 101 | + n_sout.append(make_line_count(i) + ' | ' + l_sout[i]) |
| 102 | + if l_uout[i] == l_sout[i]: |
| 103 | + n_out.append(make_line_count(i) + ' | ' + l_uout[i]) |
| 104 | + else: |
| 105 | + n_out.append(make_line_count(i) + '###' + l_uout[i]) |
| 106 | + pass |
| 107 | +for i in range(0, len(l_sin)): |
| 108 | + n_sin.append(make_line_count(i, ps_arr=l_sin) + ' | ' + l_sin[i]) |
| 109 | +test['execution-status']['input']['stdout'] = '\n'.join(n_sin) |
| 110 | +test['execution-status']['user-code']['stdout'] = '\n'.join(n_out) |
| 111 | +test['execution-status']['output']['stdout'] = '\n'.join(n_sout) |
| 112 | +%> |
81 | 113 | <div class="col-sm-4">
|
82 | 114 | <h4><b>Input</b></h4>
|
83 | 115 | <textarea style="font-family: Consolas; resize: none; width: 100%; height: 1000px;">${test['execution-status']['input']['stdout']}</textarea>
|
|
0 commit comments