forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_js.php
19 lines (16 loc) · 1 KB
/
view_js.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
$window = (!empty($quiz->popup)) ? 'quizpopup' : '_self';
$windowoptions = ($window == '_self') ? '' : "left=0, top=0, height='+window.screen.height+', width='+window.screen.width+', channelmode=yes, fullscreen=yes, scrollbars=yes, resizeable=no, directories=no, toolbar=no, titlebar=no, location=no, status=no, menubar=no";
$buttontext = ($numattempts) ? get_string('reattemptquiz', 'quiz') : get_string('attemptquiznow', 'quiz');
?>
<script language="javascript" type="text/javascript">
<!--
document.write('<input type="button" value="<?php echo $buttontext ?>" '+
'onclick="javascript: <?php if ($quiz->timelimit) echo "if (confirm(\\'$strconfirmstartattempt\\'))"; ?> '+
'window.open(\'attempt.php?id=<?php echo $cm->id ?>\', \'<?php echo $window ?>\', \'<?php echo $windowoptions ?>\'); " />');
// -->
</script>
<noscript>
<strong><?php print_string('noscript', 'quiz'); ?></strong>
</noscript>