mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
cookieless patch for quiz
This commit is contained in:
parent
16f859c161
commit
d8688c0d26
@ -200,6 +200,11 @@
|
||||
$strconfirmstartattempt = addslashes(get_string("confirmstartattempt","quiz"));
|
||||
$datecompleted = "\n".'<script language="javascript" type="text/javascript">';
|
||||
$datecompleted .= "\n<!--\n"; // -->
|
||||
if (!empty($CFG->usesid)) {
|
||||
$attempturl=sid_process_url("attempt.php?id=$cm->id");
|
||||
} else {
|
||||
$attempturl="attempt.php?id=$cm->id";
|
||||
};
|
||||
if (!empty($quiz->popup)) {
|
||||
$datecompleted .= "var windowoptions = 'left=0, top=0, height='+window.screen.height+
|
||||
', width='+window.screen.width+', channelmode=yes, fullscreen=yes, scrollbars=yes, '+
|
||||
@ -209,9 +214,9 @@
|
||||
if ($quiz->timelimit) {
|
||||
$jslink .= "if (confirm('$strconfirmstartattempt')) ";
|
||||
}
|
||||
$jslink .= "var popup = window.open(\\'attempt.php?id=$cm->id\\', \\'quizpopup\\', windowoptions);";
|
||||
$jslink .= "var popup = window.open(\\'$attempturl\\', \\'quizpopup\\', windowoptions);";
|
||||
} else {
|
||||
$jslink = "attempt.php?id=$cm->id";
|
||||
$jslink = $attempturl;
|
||||
}
|
||||
|
||||
$linktext = get_string('continueattemptquiz', 'quiz');
|
||||
|
@ -5,13 +5,18 @@ $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');
|
||||
$buttontext = ($unfinished) ? get_string('continueattemptquiz', 'quiz') : $buttontext;
|
||||
?>
|
||||
if (!empty($CFG->usesid)) {
|
||||
$attempturl=sid_process_url("attempt.php?id=$cm->id");
|
||||
} else {
|
||||
$attempturl="attempt.php?id=$cm->id";
|
||||
};
|
||||
?>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
document.write('<input type="button" value="<?php echo $buttontext ?>" '+
|
||||
'onclick="javascript: <?php if ($quiz->timelimit and !$unfinished) echo "if (confirm(\\'$strconfirmstartattempt\\'))"; ?> '+
|
||||
'window.open(\'attempt.php?id=<?php echo $cm->id ?>\', \'<?php echo $window ?>\', \'<?php echo $windowoptions ?>\'); " />');
|
||||
'window.open(\'<?php echo $attempturl ?>\', \'<?php echo $window ?>\', \'<?php echo $windowoptions ?>\'); " />');
|
||||
// -->
|
||||
</script>
|
||||
<noscript>
|
||||
|
Loading…
x
Reference in New Issue
Block a user