sourcemodule != 'quiz') and ($game->sourcemodule != 'question')){ error( get_string('millionaire_sourcemodule_must_quiz_question', 'game')); } if( $game->sourcemodule == 'quiz'){ if( $game->quizid == 0){ error( get_string( 'must_select_quiz', 'game')); } $select = "qtype='multichoice' AND quiz='$game->quizid' ". " AND qqi.question=q.id"; $table = "question q,{$CFG->prefix}quiz_question_instances qqi"; }else { if( $game->questioncategoryid == 0){ error( get_string( 'must_select_questioncategory', 'game')); } //include subcategories $select = 'category='.$game->questioncategoryid; if( $game->subcategories){ $cats = question_categorylist( $game->questioncategoryid); if( strpos( $cats, ',') > 0){ $select = 'category in ('.$cats.')'; } } $select .= " AND qtype='multichoice'"; $table = "question q"; } $select .= " AND q.hidden=0"; $recs = get_records_select( $table, $select, '', "q.id as id, q.questiontext"); $ret = ''; $retfeedback = ''; foreach( $recs as $rec){ $recs2 = get_records_select( 'question_answers', "question=$rec->id", 'fraction DESC', 'id,answer,feedback'); $line = $rec->questiontext; $linefeedback = ''; foreach( $recs2 as $rec2) { $line .= '#'.str_replace( array( '"', '#'), array( "'", ' '), $rec2->answer); $linefeedback .= '#'.str_replace( array( '"', '#'), array( "'", ' '), $rec2->feedback); } if( $ret != '') $ret .= ",\r"; $ret .= '"'.base64_encode( $line).'"'; if( $retfeedback != '') $retfeedback .= ",\r"; $retfeedback .= '"'.base64_encode( $linefeedback).'"'; if( count( $recs2) > $max) $max = count( $recs2); $countofquestions++; } return $ret; } function game_millionaire_html_print( $game, $questions, $maxquestions) { $color1 = 'black'; $color2 = 'DarkOrange'; $colorback="white"; $stylequestion = "background:$colorback;color:$color1"; $stylequestionselected = "background:$colorback;color:$color2"; ?>
> | > | ||||||||
style='background:#408080'> | 15 | 150000 | |||||||
14 | 800000 | ||||||||
13 | 400000 | ||||||||
aa |
12 | 200000 | |||||||
11 | 10000 | ||||||||
10 | 5000 | ||||||||
9 | 4000 | ||||||||
8 | 2000 | ||||||||
7 | 1500 | ||||||||
6 | 1000 | ||||||||
5 | 500 | ||||||||
4 | 400 | ||||||||
3 | 300 | ||||||||
2 | 200 | ||||||||
1 | 100 | ||||||||
"; echo ""; echo " | \n"; echo "\n"; if( $i == 1) { echo " | \n"; } echo " | |||||||