| … | |
… | |
| 31 | # TODO: |
31 | # TODO: |
| 32 | # :) enforce permissions for showCorrectAnswers and showSolutions |
32 | # :) enforce permissions for showCorrectAnswers and showSolutions |
| 33 | # (use $PRIV = $mustPRIV || ($canPRIV && $wantPRIV) -- cool syntax!) |
33 | # (use $PRIV = $mustPRIV || ($canPRIV && $wantPRIV) -- cool syntax!) |
| 34 | # :) if answers were not submitted and there are student answers in the DB, |
34 | # :) if answers were not submitted and there are student answers in the DB, |
| 35 | # decode them and put them into $formFields for the translator |
35 | # decode them and put them into $formFields for the translator |
| 36 | # 3. Latex2HTML massaging code |
|
|
| 37 | # :) store submitted answers hash in database for sticky answers |
36 | # :) store submitted answers hash in database for sticky answers |
| 38 | # :) deal with the results of answer evaluation and grading :p |
37 | # :) deal with the results of answer evaluation and grading :p |
| 39 | # :) introduce a recordAnswers option, which works on the same principle as |
38 | # :) introduce a recordAnswers option, which works on the same principle as |
| 40 | # the other permission-based options |
39 | # the other permission-based options |
| 41 | # 7. make warnings work |
40 | # 7. make warnings work |
| … | |
… | |
| 123 | $r->param('user'), |
122 | $r->param('user'), |
| 124 | $r->param('key'), |
123 | $r->param('key'), |
| 125 | $setName, |
124 | $setName, |
| 126 | $problemNumber, |
125 | $problemNumber, |
| 127 | { # translation options |
126 | { # translation options |
| 128 | displayMode => $displayMode, |
127 | displayMode => $displayMode, |
| 129 | showHints => $will{showHints}, |
128 | showHints => $will{showHints}, |
| 130 | showSolutions => $will{showSolutions}, |
129 | showSolutions => $will{showSolutions}, |
|
|
130 | refreshMath2img => $will{showHints} || $will{showSolutions}, |
| 131 | # try leaving processAnswers on all the time? |
131 | # try leaving processAnswers on all the time? |
| 132 | processAnswers => 1, #$submitAnswers ? 1 : 0, |
132 | processAnswers => 1, #$submitAnswers ? 1 : 0, |
| 133 | }, |
133 | }, |
| 134 | $formFields |
134 | $formFields |
| 135 | ); |
135 | ); |
| 136 | |
136 | |
| 137 | # handle any errors in translation |
137 | # handle any errors in translation |
| … | |
… | |
| 141 | h2("Software Error"), |
141 | h2("Software Error"), |
| 142 | translationError($pg->{errors}, $pg->{body_text}); |
142 | translationError($pg->{errors}, $pg->{body_text}); |
| 143 | |
143 | |
| 144 | return ""; |
144 | return ""; |
| 145 | } |
145 | } |
| 146 | |
|
|
| 147 | # massage LaTeX2HTML [TODO #3] |
|
|
| 148 | |
146 | |
| 149 | ##### answer processing ##### |
147 | ##### answer processing ##### |
| 150 | |
148 | |
| 151 | # if answers were submitted: |
149 | # if answers were submitted: |
| 152 | if ($submitAnswers) { |
150 | if ($submitAnswers) { |