Skip to content
Browse files

Fixed mistake in category selection - now correctly shows selected ca…

…tegory
  • Loading branch information...
1 parent 684d865 commit eea4477b95e064737c7dfc006adb70727066f63c thepurpleblob committed
Showing with 6 additions and 2 deletions.
  1. +6 −2 mod/quiz/lib.php
View
8 mod/quiz/lib.php
@@ -1342,7 +1342,7 @@ function quiz_print_category_form($course, $current) {
echo "</td></tr></table>";
}
-function quiz_category_select_menu($courseid,$published=false,$only_editable=false) {
+function quiz_category_select_menu($courseid,$published=false,$only_editable=false,$selected="") {
/// displays a select menu of categories with appended coursenames
/// optionaly non editable categories may be excluded
/// added Howard Miller June '04
@@ -1356,8 +1356,12 @@ function quiz_category_select_menu($courseid,$published=false,$only_editable=fal
foreach ($categories as $category) {
$cid = $category->id;
$cname = quiz_get_category_coursename( $category );
+ $seltxt = "";
+ if ($cid==$selected) {
+ $seltxt = "selected=\"true\"";
+ }
if ((!$only_editable) || isteacheredit($category->course)) {
- echo " <option value=\"$cid\">$cname</option>\n";
+ echo " <option value=\"$cid\" $seltxt>$cname</option>\n";
}
}
echo "</select>\n";

0 comments on commit eea4477

Please sign in to comment.
Something went wrong with that request. Please try again.