[system] / trunk / webwork / system / cgi / cgi-scripts / processProblem8.pl Repository:
ViewVC logotype

Diff of /trunk/webwork/system/cgi/cgi-scripts/processProblem8.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 362 Revision 363
1109 1109
1110 1110
1111 1111
1112sub format_navigation_bar { 1112sub format_navigation_bar {
1113my ($previousProbNum, $nextProbNum,$numberOfProblems) = @_; 1113my ($previousProbNum, $nextProbNum,$numberOfProblems) = @_;
1114 my $navigation_bar = ''; 1114
1115 $navigation_bar .= qq{ 1115## first set up the navigation button forms
1116 <TABLE BORDER="0" WIDTH="100%"> 1116
1117 <TR ALIGN=CENTER VALIGN=TOP > 1117 my $prev_prob_form = '';
1118 <TD ALIGN=LEFT VALIGN=MIDDLE> 1118 unless($previousProbNum <= 0) {
1119 <TABLE><TR><TD ALIGN=CENTER VALIGN=MIDDLE> 1119 $prev_prob_form .= $cgi->startform(-method=>'POST', -action=>"$Global::processProblem_CGI"). "\n".
1120 $cgi->input({-type=>'IMAGE', -src=>"$Global::previousImgUrl", -alt=>'<--Previous Problem'}). "\n".
1121 $cgi->hidden(-name=>'probSetKey', -value=>"$inputs{probSetKey}"). "\n".
1122 $cgi->hidden(-name=>'probNum', -value=>"$previousProbNum", -override=>1). "\n".
1123 $cgi->hidden(-name=>'Mode', -value=>"$inputs{Mode}"). "\n".
1124 $cgi->hidden(-name=>'show_old_answers', -value=>$show_old_answers). "\n".
1125 $cgi->hidden(-name=>'user', -value=>"$inputs{user}"). "\n".
1126 $cgi->hidden(-name=>'key', -value=>"$inputs{key}"). "\n".
1127 $cgi->hidden(-name=>'course', -value=>"$inputs{course}"). "\n".
1128 $cgi->endform(). "\n";
1120 }; 1129 };
1121 1130
1122 unless($previousProbNum <= 0) {
1123 $navigation_bar .= $cgi->startform(-method=>'POST', -action=>"$Global::processProblem_CGI"). "\n".
1124 $cgi->input({-type=>'IMAGE', -src=>"$Global::previousImgUrl", -alt=>'<--Previous Problem'}). "\n".
1125 $cgi->hidden(-name=>'probSetKey', -value=>"$inputs{probSetKey}"). "\n".
1126 $cgi->hidden(-name=>'probNum', -value=>"$previousProbNum", -override=>1). "\n".
1127 $cgi->hidden(-name=>'Mode', -value=>"$inputs{Mode}"). "\n".
1128 $cgi->hidden(-name=>'show_old_answers', -value=>$show_old_answers). "\n".
1129 $cgi->hidden(-name=>'user', -value=>"$inputs{user}"). "\n".
1130 $cgi->hidden(-name=>'key', -value=>"$inputs{key}"). "\n".
1131 $cgi->hidden(-name=>'course', -value=>"$inputs{course}"). "\n".
1132 $cgi->endform(). "\n";
1133
1134# $navigation_bar .= qq{
1135# <A HREF="$Global::processProblem_CGI?probSetKey=$inputs{'probSetKey'}&probNum=$previousProbNum&Mode=$inputs{'Mode'}&course=$inputs{'course'}&user=$inputs{'user'}&key=$inputs{'key'}">
1136# <IMG SRC="$Global::previousImgUrl" ALT="&lt;--Previous Problem"></A>
1137# };
1138 };
1139
1140 $navigation_bar .= qq{
1141 </TD> <TD ALIGN=CENTER VALIGN=MIDDLE>
1142 };
1143
1144 $navigation_bar .= $cgi->startform(-method=>'POST', -action=>"$Global::welcomeAction_CGI"). "\n". 1131 my $prob_list_form = $cgi->startform(-method=>'POST', -action=>"$Global::welcomeAction_CGI"). "\n".
1145 $cgi->input({-type=>'IMAGE', -src=>"$Global::problistImgUrl", -alt=>'Problem List'}). "\n". 1132 $cgi->input({-type=>'IMAGE', -src=>"$Global::problistImgUrl", -alt=>'Problem List'}). "\n".
1146 $cgi->hidden(-name=>'local_psvns', -value=>"$inputs{probSetKey}"). "\n". 1133 $cgi->hidden(-name=>'local_psvns', -value=>"$inputs{probSetKey}"). "\n".
1147 $cgi->hidden(-name=>'probSetKey', -value=>"$inputs{probSetKey}"). "\n". 1134 $cgi->hidden(-name=>'probSetKey', -value=>"$inputs{probSetKey}"). "\n".
1148 $cgi->hidden(-name=>'action', -value=>"Do_problem_set",-override=>1). "\n". 1135 $cgi->hidden(-name=>'action', -value=>"Do_problem_set",-override=>1). "\n".
1149 $cgi->hidden(-name=>'Mode', -value=>"$inputs{Mode}"). "\n". 1136 $cgi->hidden(-name=>'Mode', -value=>"$inputs{Mode}"). "\n".
1150 $cgi->hidden(-name=>'user', -value=>"$inputs{user}"). "\n". 1137 $cgi->hidden(-name=>'user', -value=>"$inputs{user}"). "\n".
1151 $cgi->hidden(-name=>'key', -value=>"$inputs{key}"). "\n". 1138 $cgi->hidden(-name=>'key', -value=>"$inputs{key}"). "\n".
1152 $cgi->hidden(-name=>'course', -value=>"$inputs{course}"). "\n". 1139 $cgi->hidden(-name=>'course', -value=>"$inputs{course}"). "\n".
1153 $cgi->endform(). "\n"; 1140 $cgi->endform(). "\n";
1154 1141
1155# $navigation_bar .= qq{ 1142
1156# <A HREF="$Global::welcomeAction_CGI?local_psvns=$inputs{'probSetKey'}&Mode=$inputs{'Mode'}&course=$inputs{'course'}&user=$inputs{'user'}&action=Do_problem_set&key=$inputs{'key'}"> 1143 my $next_prob_form = '';
1157# <IMG SRC="$Global::problistImgUrl" ALT="Problem List"></A>
1158# };
1159
1160 $navigation_bar .= qq{ </TD>
1161
1162 <TD ALIGN=CENTER VALIGN=MIDDLE>
1163 };
1164
1165 unless($nextProbNum > $numberOfProblems) { 1144 unless($nextProbNum > $numberOfProblems) {
1166
1167 $navigation_bar .= $cgi->startform(-method=>'POST', -action=>"$Global::processProblem_CGI"). "\n". 1145 $next_prob_form .= $cgi->startform(-method=>'POST', -action=>"$Global::processProblem_CGI"). "\n".
1168 $cgi->input({-type=>'IMAGE', -src=>"$Global::nextImgUrl", -alt=>'Next Problem-->'}). "\n". 1146 $cgi->input({-type=>'IMAGE', -src=>"$Global::nextImgUrl", -alt=>'Next Problem-->'}). "\n".
1169 $cgi->hidden(-name=>'probSetKey', -value=>"$inputs{probSetKey}"). "\n". 1147 $cgi->hidden(-name=>'probSetKey', -value=>"$inputs{probSetKey}"). "\n".
1170 $cgi->hidden(-name=>'probNum', -value=>"$nextProbNum", -override=>1). "\n". 1148 $cgi->hidden(-name=>'probNum', -value=>"$nextProbNum", -override=>1). "\n".
1171 $cgi->hidden(-name=>'Mode', -value=>"$inputs{Mode}"). "\n". 1149 $cgi->hidden(-name=>'Mode', -value=>"$inputs{Mode}"). "\n".
1172 $cgi->hidden(-name=>'show_old_answers', -value=>$show_old_answers). "\n". 1150 $cgi->hidden(-name=>'show_old_answers', -value=>$show_old_answers). "\n".
1173 $cgi->hidden(-name=>'user', -value=>"$inputs{user}"). "\n". 1151 $cgi->hidden(-name=>'user', -value=>"$inputs{user}"). "\n".
1174 $cgi->hidden(-name=>'key', -value=>"$inputs{key}"). "\n". 1152 $cgi->hidden(-name=>'key', -value=>"$inputs{key}"). "\n".
1175 $cgi->hidden(-name=>'course', -value=>"$inputs{course}"). "\n". 1153 $cgi->hidden(-name=>'course', -value=>"$inputs{course}"). "\n".
1176 $cgi->endform(). "\n"; 1154 $cgi->endform(). "\n";
1177
1178# $navigation_bar .= qq{
1179# <A HREF="$Global::processProblem_CGI?probSetKey=$inputs{'probSetKey'}&probNum=$nextProbNum&Mode=$inputs{'Mode'}&course=$inputs{'course'}&user=$inputs{'user'}&key=$inputs{'key'}">
1180# <IMG SRC="$Global::nextImgUrl" ALT="Next Problem--&gt;"></A>
1181# };
1182 }
1183
1184 $navigation_bar .= qq{ </TD>
1185 </TR></TABLE></TD><TD ALIGN=RIGHT VALIGN=TOP ROWSPAN=2>
1186
1187 }; 1155 }
1188 1156
1157## next set up the inner table
1158 my $inner_table =
1159 $cgi->table(
1160 $cgi->Tr(
1161 $cgi->td({-allign=>'CENTER', -valign=>'MIDDLE'},[$prev_prob_form, $prob_list_form, $next_prob_form])
1162 )
1163 );
1164
1165## finally set up the main table
1189 $navigation_bar .= qq{ 1166 my $navigation_bar =
1190 <A HREF="$Global::webworkDocsURL"> 1167 $cgi->table({-border=>0,-width=>'100%'},
1191 <IMG SRC="$Global::squareWebworkGif" BORDER=1 ALT="WeBWorK"></A> 1168 $cgi->Tr({-align=>'CENTER', -valign=>'TOP'},
1192 1169 $cgi->td({-align=>'LEFT', -valign=>'MIDDLE'},$inner_table),
1193 </TD></TR> 1170 $cgi->td({-align=>'RIGHT', -valign=>'TOP', -rowspan=>2},
1194 <TR><TD ALIGN=LEFT VALIGN=BOTTOM> <H4>$problemStatusMessage</H4> 1171 $cgi->a({-href=>$Global::webworkDocsURL}, $cgi->img({-src=>$Global::squareWebworkGif,-border=>1,-alt=>'WeBWorK Docs'}))
1195 </TD></TR> 1172 )
1196 </TABLE> 1173 ),
1197 }; 1174 $cgi->Tr(
1198 # $navigation_bar =~ s/&/&amp;/g; # urlEncode hack. 1175 $cgi->td({-align=>'LEFT', -valign=>'BOTTOM'}, $cgi->h4($problemStatusMessage))
1199 1176 )
1177 );
1200 return $navigation_bar; 1178 return $navigation_bar;
1201} 1179}
1202 1180
1203 1181
1204sub format_preview_navigation_bar { 1182sub format_preview_navigation_bar {
1205my $curentProbNum = shift; 1183my $curentProbNum = shift;
1206 my $navigation_bar = ''; 1184 my $navigation_bar = '';
1207 $navigation_bar .= qq{ 1185 $navigation_bar .= qq{
1208 <TABLE BORDER="0" WIDTH="100%"> 1186 <TABLE BORDER="0" WIDTH="100%">
1209 <TR ALIGN=CENTER VALIGN=TOP > 1187 <TR ALIGN="CENTER" VALIGN=TOP >
1210 <TD ALIGN=LEFT VALIGN=MIDDLE> 1188 <TD ALIGN=LEFT VALIGN=MIDDLE>
1211 <TABLE><TR><TD ALIGN=CENTER VALIGN=MIDDLE> 1189 <TABLE><TR><TD ALIGN="CENTER" VALIGN=MIDDLE>
1212 }; 1190 };
1213 1191
1214 1192
1215 $navigation_bar .= $cgi->startform(-method=>'POST', -action=>"$Global::processProblem_CGI"). "\n". 1193 $navigation_bar .= $cgi->startform(-method=>'POST', -action=>"$Global::processProblem_CGI"). "\n".
1216 $cgi->input({-type=>'IMAGE', -src=>"$Global::currentImgUrl", -alt=>'Current Problem'}). "\n". 1194 $cgi->input({-type=>'IMAGE', -src=>"$Global::currentImgUrl", -alt=>'Current Problem'}). "\n".
1228# <A HREF="$Global::processProblem_CGI?probSetKey=$inputs{'probSetKey'}&probNum=$curentProbNum&Mode=$inputs{'Mode'}&course=$inputs{'course'}&user=$inputs{'user'}&key=$inputs{'key'}"> 1206# <A HREF="$Global::processProblem_CGI?probSetKey=$inputs{'probSetKey'}&probNum=$curentProbNum&Mode=$inputs{'Mode'}&course=$inputs{'course'}&user=$inputs{'user'}&key=$inputs{'key'}">
1229# <IMG SRC="$Global::currentImgUrl" ALT="Current Problem"></A> 1207# <IMG SRC="$Global::currentImgUrl" ALT="Current Problem"></A>
1230# }; 1208# };
1231 1209
1232 $navigation_bar .= qq{ 1210 $navigation_bar .= qq{
1233 </TD> <TD ALIGN=CENTER VALIGN=MIDDLE> 1211 </TD> <TD ALIGN="CENTER" VALIGN=MIDDLE>
1234 }; 1212 };
1235 1213
1236 $navigation_bar .= qq{ 1214 $navigation_bar .= qq{
1237 </TD> <TD ALIGN=CENTER VALIGN=MIDDLE> 1215 </TD> <TD ALIGN="CENTER" VALIGN=MIDDLE>
1238 }; 1216 };
1239 1217
1240 $navigation_bar .= $cgi->startform(-method=>'POST', -action=>"$Global::welcomeAction_CGI"). "\n". 1218 $navigation_bar .= $cgi->startform(-method=>'POST', -action=>"$Global::welcomeAction_CGI"). "\n".
1241 $cgi->input({-type=>'IMAGE', -src=>"$Global::problistImgUrl", -alt=>'Problem List'}). "\n". 1219 $cgi->input({-type=>'IMAGE', -src=>"$Global::problistImgUrl", -alt=>'Problem List'}). "\n".
1242 $cgi->hidden(-name=>'local_psvns', -value=>"$inputs{probSetKey}"). "\n". 1220 $cgi->hidden(-name=>'local_psvns', -value=>"$inputs{probSetKey}"). "\n".
1255# <IMG SRC="$Global::problistImgUrl" ALT="Problem List"></A> 1233# <IMG SRC="$Global::problistImgUrl" ALT="Problem List"></A>
1256# }; 1234# };
1257 1235
1258 $navigation_bar .= qq{ </TD> 1236 $navigation_bar .= qq{ </TD>
1259 1237
1260 <TD ALIGN=CENTER VALIGN=MIDDLE> 1238 <TD ALIGN="CENTER" VALIGN=MIDDLE>
1261 }; 1239 };
1262 1240
1263 $navigation_bar .= qq{ </TD> 1241 $navigation_bar .= qq{ </TD>
1264 </TR></TABLE></TD><TD ALIGN=RIGHT VALIGN=TOP WIDTH="20%" ROWSPAN=2> 1242 </TR></TABLE></TD><TD ALIGN=RIGHT VALIGN=TOP WIDTH="20%" ROWSPAN=2>
1265 1243

Legend:
Removed from v.362  
changed lines
  Added in v.363

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9