diff --git a/cryptex/play.php b/cryptex/play.php index 62bddb0..5829aef 100755 --- a/cryptex/play.php +++ b/cryptex/play.php @@ -127,7 +127,7 @@ function game_cryptex_check( $id, $game, $attempt, $cryptexrec, $q, $answer, $co game_cryptex_play( $id, $game, $attempt, $cryptexrec, $crossm, true, $onlyshow, $showsolution, $context); } -function game_cryptex_play( $id, $game, $attempt, $cryptexrec, $crossm, $updateattempt=false, $onlyshow=false, $showsolution=false, $context) +function game_cryptex_play( $id, $game, $attempt, $cryptexrec, $crossm, $updateattempt=false, $onlyshow=false, $showsolution=false, $context, $print=false, $showhtmlprintbutton=true) { global $DB; @@ -219,6 +219,11 @@ width: 240pt; --> '; + echo ''; echo '
'; $cryptex->displaycryptex( $crossm->cols, $crossm->rows, $cryptexrec->letters, $mask, $showsolution, $textdir); @@ -239,7 +244,7 @@ width: 240pt; style="font-weight: bold; text-transform:uppercase;" autocomplete="off"> -
+print  
@@ -248,12 +253,37 @@ width: 240pt;
+'.get_string( 'print', 'game'); + echo ''; + } + +if( $showhtmlprintbutton){ +?> + +
"; $i = 0; $else = ''; $contextglossary = false; @@ -305,8 +335,15 @@ width: 240pt; } '; + }else{ + echo ''; + } } + function game_cryptex_onfinished( $id, $game, $attempt, $cryptexrec) { global $CFG, $DB; diff --git a/print.php b/print.php index f3daf0c..8e04fab 100755 --- a/print.php +++ b/print.php @@ -17,16 +17,17 @@ require_login( $game->course); - $context = get_context_instance(CONTEXT_MODULE, $id); + $context = game_get_context_module_instance( $id); require_capability('mod/game:view', $context); game_print( $game, $id, $context); function game_print( $game, $update, $context){ - if( $game->gamekind == 'cross'){ + if( $game->gamekind == 'cross') game_print_cross( $game, $update, $context); - } + else if( $game->gamekind == 'cryptex') + game_print_cryptex( $game, $update, $context); } function game_print_cross( $game, $update, $context) @@ -53,5 +54,32 @@ get_record_select( 'game_cross', "id=$attempt->id"); + +?> + + + Print + +component = 'mod_game'; // Full name of the plugin (used for diagnostics) -$plugin->version = 2015071203; // The current module version (Date: YYYYMMDDXX) +$plugin->version = 2015071204; // The current module version (Date: YYYYMMDDXX) $plugin->requires = 2010112400; // Requires Moodle 2.0 $plugin->cron = 0; // Period for cron to check this module (secs) -$plugin->release = '3.30.12.3'; +$plugin->release = '3.30.12.4'; if( $useplugin != 2) $module = $plugin;