sourcemodule != 'quiz') and ($game->sourcemodule != 'question')){ print_error( get_string('millionaire_sourcemodule_must_quiz_question', 'game', get_string( 'modulename', 'quiz')).' '.get_string( 'modulename', $game->sourcemodule)); } if( $game->sourcemodule == 'quiz'){ if( $game->quizid == 0){ print_error( get_string( 'must_select_quiz', 'game')); } $select = "qtype='multichoice' AND quiz='$game->quizid' ". " AND qqi.question=q.id"; $table = "{question} q,{quiz_question_instances} qqi"; }else { if( $game->questioncategoryid == 0){ print_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"; $sql = "SELECT q.id as id, q.questiontext FROM $table WHERE $select"; $recs = $DB->get_records_sql( $sql); $ret = ''; $retfeedback = ''; foreach( $recs as $rec){ $recs2 = $DB->get_records( 'question_answers', array( 'question' => $rec->id), 'fraction DESC', 'id,answer,feedback'); //Must parse the questiontext and get the name of files. $line = $rec->questiontext; $line = game_export_split_files( $game->course, $context, 'questiontext', $rec->id, $rec->questiontext, $destdir, $files); $linefeedback = ''; foreach( $recs2 as $rec2) { $line .= '#'.str_replace( array( '"', '#'), array( "'", ' '), game_export_split_files( $game->course, $context, 'answer', $rec2->id, $rec2->answer, $destdir, $files)); $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) > $maxanswers) $maxanswers = 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"; ?> \n"; echo "\n"; echo "\n"; if( $i == 1) { echo "\n"; } echo "\n"; } ?>
>                >        
        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 "