| … | |
… | |
| 16 | use base qw(WeBWorK::ContentGenerator); |
16 | use base qw(WeBWorK::ContentGenerator); |
| 17 | use CGI qw(); |
17 | use CGI qw(); |
| 18 | use WeBWorK::Form; |
18 | use WeBWorK::Form; |
| 19 | use WeBWorK::PG; |
19 | use WeBWorK::PG; |
| 20 | use WeBWorK::Utils qw(ref2string encodeAnswers decodeAnswers); |
20 | use WeBWorK::Utils qw(ref2string encodeAnswers decodeAnswers); |
| 21 | |
|
|
| 22 | # TODO: |
|
|
| 23 | # 7. make warnings work |
|
|
| 24 | |
21 | |
| 25 | ############################################################ |
22 | ############################################################ |
| 26 | # |
23 | # |
| 27 | # user |
24 | # user |
| 28 | # key |
25 | # key |
| … | |
… | |
| 189 | |
186 | |
| 190 | my $ce = $self->{courseEnvironment}; |
187 | my $ce = $self->{courseEnvironment}; |
| 191 | my $root = $ce->{webworkURLs}->{root}; |
188 | my $root = $ce->{webworkURLs}->{root}; |
| 192 | my $courseName = $ce->{courseName}; |
189 | my $courseName = $ce->{courseName}; |
| 193 | |
190 | |
|
|
191 | print CGI::strong("Problems"), CGI::br(); |
|
|
192 | |
| 194 | my $wwdb = $self->{wwdb}; |
193 | my $wwdb = $self->{wwdb}; |
| 195 | my $user = $self->{r}->param("user"); |
194 | my $user = $self->{r}->param("user"); |
| 196 | my @problems; |
195 | my @problems; |
| 197 | push @problems, $wwdb->getProblem($user, $setName, $_) |
196 | push @problems, $wwdb->getProblem($user, $setName, $_) |
| 198 | foreach ($wwdb->getProblems($user, $setName)); |
197 | foreach ($wwdb->getProblems($user, $setName)); |
| … | |
… | |
| 251 | my $pg = $self->{pg}; |
250 | my $pg = $self->{pg}; |
| 252 | |
251 | |
| 253 | ##### translation errors? ##### |
252 | ##### translation errors? ##### |
| 254 | |
253 | |
| 255 | if ($pg->{flags}->{error_flag}) { |
254 | if ($pg->{flags}->{error_flag}) { |
| 256 | print translationError($pg->{errors}, $pg->{body_text}); |
255 | return translationError($pg->{errors}, $pg->{body_text}); |
| 257 | return ""; |
|
|
| 258 | } |
256 | } |
| 259 | |
257 | |
| 260 | ##### answer processing ##### |
258 | ##### answer processing ##### |
| 261 | |
259 | |
| 262 | # if answers were submitted: |
260 | # if answers were submitted: |
| … | |
… | |
| 358 | return ""; |
356 | return ""; |
| 359 | } |
357 | } |
| 360 | |
358 | |
| 361 | ##### output utilities ##### |
359 | ##### output utilities ##### |
| 362 | |
360 | |
|
|
361 | # this is used by ProblemSet.pm too, so don't fuck it up |
| 363 | sub translationError($$) { |
362 | sub translationError($$) { |
| 364 | my ($error, $details) = @_; |
363 | my ($error, $details) = @_; |
| 365 | return |
364 | return |
| 366 | CGI::h2("Software Error"), |
365 | CGI::h2("Software Error"), |
| 367 | CGI::p(<<EOF), |
366 | CGI::p(<<EOF), |