hai
this is archulu, i am doing online examinaiton project.in my project i want to print 10 questions per page. my problem is i am taking 50 from data base but how i print these quetions in 5 pages.each page contain 10 questions only.
and also some condition we can freely move 5 pages easily at last time was expired naa that time result value stored in result table.up to that we can stroe the result in temprary hash variable.
plz help to me about these problems
thanks
3 1340
If you want help with your project post your existing perl code.
Also, your English is so bad that much of what you posted is impossible to understand.
ok sir thank you so much for ur suggistion
this is my project code, this progrm gives the output question and answers in only one page. but i want to print questions in more than one page.each page having only 10 questions
plz help to me -
package Anchor::Attitude_Test;
-
-
use Apache::Constants qw(:common);
-
use Apache::Request;
-
use DBI;
-
use Apache::Session::File;
-
use Apache::Constants qw(OK);
-
use Apache::Constants qw(REDIRECT);
-
-
sub handler {
-
my $r = Apache::Request->new(shift);
-
my %session;
-
my $session_id = $r->param('session');
-
-
eval {tie %session,'Apache::Session::File',$session_id;};
-
if($@) {
-
$r->content_type('text/html');
-
$location = 'http://jasmine.ueltv.org/Anchor/session_expired';
-
$r->header_out(Location=>$location);
-
return REDIRECT;
-
}
-
-
-
@months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
-
@weekDays = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
-
($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $daylightSavings) = localtime();
-
$year = 1900 + $yearOffset;
-
$theTime = "$hour:$minute:$second, $weekDays[$dayOfWeek] $months[$month] $dayOfMonth $year";
-
-
@val = split /\,/, $theTime;
-
-
$time = $val[0];
-
$da= $val[1];
-
-
my $desg="Anchor1";
-
chomp($guid=`uuidgen`);
-
my $dbh = DBI->connect("dbi:Pg:dbname=ANCHOR_GRADE;host=jasmine.ueltv.org","lakshmi","") or die "Can't connect DBI::errstr\n";
-
$sth=$dbh->prepare("insert into attitude_exam_details(guid,exam_no,s_time,date_of_exam) values(?,?,?,?)") or warn "Erron in prepare statemt ".$dbh->errstr;
-
$sth1=$dbh->prepare("select max(exam_no) from attitude_exam_details") or warn"Error in prepare statement".$dbh->errstr;
-
my $ExamDetails_Sth = $dbh->prepare("select sno,exam_code,no_of_questions,time_duration,subject_values from exam_master where exam_code = ? ");
-
-
$ExamDetails_Sth->execute($desg);
-
# Result Should be 1 Row
-
my @ExamDetails = $ExamDetails_Sth->fetchrow_array();
-
my $timeduration=$ExamDetails[3];
-
my @tmp = split(',',$ExamDetails[4]);
-
-
my %Question_Sum;
-
foreach (@tmp) {
-
my @sub = split('=',$_);
-
$Question_Sum{$sub[0]} = $sub[1];
-
}
-
-
$sth1->execute();
-
@n=$sth1->fetchrow_array();
-
$ei=$n[0];
-
$ei++;
-
my $res=$sth->execute($guid,$ei,$time,$da);
-
-
print <<HTML;
-
<html>
-
<head>
-
<title>Home Page</title>
-
<link rel="stylesheet" type="text/css" href="http://jasmine.ueltv.org/special.css">
-
<link rel="stylesheet" type="text/css" href="http://jasmine.ueltv.org/Special.css">
-
<style type='text/css'>
-
.Button {
-
position:absolute;
-
width:96%;
-
font-size:15px;
-
font-weight:bold;
-
padding: 6px;
-
color:blcak;
-
border:1px solid #5AAC22;
-
background: url(http://jasmine.ueltv.org://headernav_02.jpg);
-
}
-
</style>
-
</head>
-
<script type="text/javascript">
-
var _countDowncontainer=0;
-
var _currentSeconds= 0;
-
function ActivateCountDown(strContainerID, initialValue) {
-
_countDowncontainer = document.getElementById(strContainerID);
-
if (!_countDowncontainer) {
-
alert("count down error: container does not exist: "+strContainerID+"make sure html element with this ID exists");
-
return;
-
}
-
SetCountdownText(initialValue);
-
window.setTimeout("CountDownTick()", 1000);
-
}
-
function CountDownTick() {
-
if (_currentSeconds <= 0) {
-
alert("your time has expired!");
-
return;
-
}
-
SetCountdownText(_currentSeconds-1);
-
window.setTimeout("CountDownTick()", 1000);
-
}
-
function SetCountdownText(seconds) {
-
//store:
-
_currentSeconds = seconds;
-
//get minutes:
-
var minutes=parseInt(seconds/60);
-
//shrink:
-
seconds = (seconds%60);
-
//get hours:
-
var hours=parseInt(minutes/60);
-
//shrink:
-
minutes = (minutes%60);
-
//build text:
-
var strText = AddZero(hours) + ":" + AddZero(minutes) + ":" + AddZero(seconds);
-
//apply:
-
_countDowncontainer.innerHTML = strText;
-
}
-
function AddZero(num) {
-
return ((num >= 0)&&(num < 10))?"0"+num:num+"";
-
}
-
function add_result(frm) {
-
var url = 'http://jasmine.ueltv.org/Anchor/Attitude_Result_report?session=$session_id';
-
frm.action=url;
-
frm.submit();
-
}
-
</script>
-
<body onload="ActivateCountDown('timelable',$timeduration );">
-
-
<div id="maincontent">
-
<form name='frm' method = post>
-
<table width='100%' cellpadding=5 >
-
<tr><td class=Button><table border = 0 width = 100% >
-
<tr>
-
<td align=right>Start Time :</td><td align=left> $time<size = 10></td>
-
<td align=right>Exam Id : </td><td align=left> <input type=hidden name=examid value=$ei> $ei <size=10></td></td>
-
<td align=right>Date of Exam : </td><td align=left>$da</td>
-
</tr>
-
</table></th></tr>
-
</table>
-
<br><br>
-
<table width='100%' >
-
<tr><td align=right>Remaining Time:<td><td align=left><div id=timelable></div></td></tr>
-
<tr><td>
-
HTML
-
-
my $sno = 1;
-
foreach my $subject(keys %Question_Sum) {
-
my $limit = $Question_Sum{$subject};
-
my $sth3=$dbh->prepare("select qsno, question, choice_a,choice_b,choice_c,choice_d,choice_e from question_master where subject = '$subject' ORDER BY RANDOM() LIMIT $limit") or warn "Error in prepare statement".$dbh->errstr;
-
$sth3->execute();
-
-
while(@a = $sth3->fetchrow_array()) {
-
print <<HTML;
-
<tr><td align=left><p style='font-size:15px'>$sno.$a[1]</p><input type=hidden name="Q_$a[0]" value="Q_$a[0]"></td></tr>
-
<tr><td align=left><input type="radio" name="QS_$a[0]" value="A:$a[2]">A:$a[2]<br /> </td></tr>
-
<tr><td align=left><input type="radio" name="QS_$a[0]" value="B:$a[3]">B:$a[3]<br /></td></tr>
-
<tr><td align=left><input type="radio" name="QS_$a[0]" value="C:$a[4]">C:$a[4]<br /></td></tr>
-
<tr><td align=left><input type="radio" name="QS_$a[0]" value="D:$a[5]">D:$a[5]<br /></td></tr>
-
<tr><td align=left><input type="radio" name="QS_$a[0]" value="E:$a[6]">E:$a[6]<br /></td></tr>
-
<tr><td></td></tr>
-
<tr><td></td></tr>
-
HTML
-
$sno++;
-
}
-
}
-
-
print <<HTML;
-
</table>
-
</table>
-
<table width='100%' >
-
<tr><td align=center><input type=button name='add' value='Submit' onclick='add_result(this.form)' accesskey="s" title="alt+s"></td></tr>
-
</td></tr>
-
</table>
-
</form>
-
</body>
-
</html>
-
HTML
-
-
return OK;
-
}
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jason |
last post by:
Hello,
I am working on a website which uses forms to fill in a few answers to
questions. Does anybody know a javascript that prints only the answers
(i.e. the forms) and not the whole page?
I...
|
by: Alan |
last post by:
While not rs.eof
<td><%=rs("InvoiceNo")%></td>
<td><%=rs("Name")%></td>
<td><a href="InvoicePrint.asp?WInv=<%=rs("InvoiceNo")%>"></a></td>
<td>Print this invoice</td>
rs.MoveNext
Wend
Now...
|
by: Marcos Beccar Varela |
last post by:
Hello to all, I have this form with a PrintDocument named prt_doc,
theproblem is that when I invoke the prt_doc.print() it only prints the las
page, and not multiple pages.
I Also Have a Preview...
|
by: Phil |
last post by:
When I print an aspx page built in Asp.Net 2.0 (c# - Visual Studios 2005) the
resulting print page is cut-off. Anything that spans too far to the right,
or to far down is clipped - multiple pages...
|
by: Daniel Crespo |
last post by:
Hi to all,
I want to print a PDF right from my python app transparently. With
"transparently" I mean that no matter what program handles the print
petition, the user shouldn't be noticed about...
|
by: ShaneO |
last post by:
There have been similar questions raised in the past, however no answers
seem to have been provided, so I thought I'd give it a go.
Scenario 1:
My Windows Forms app generates (say) 10 pages in a...
|
by: Greg Esres |
last post by:
I have some text lines to print that are much longer than the width of
the paper, maybe as much as 6 times. For a given page, I'd like
everything that doesn't fit to print on a second page, and...
|
by: jen6575 |
last post by:
Hello,
I have a client who wants their website to print exactly as it looks
on the screen. Yes, exactly. No hiding anything. In IE6, some pages
print perfectly fine, some print fine but also...
|
by: tdw |
last post by:
Hi,
I have searched for this answer to no avail. I've found some very similar questions, but no answers that seem to apply.
Here's the deal: All reports work fine on my computer. My boss,...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |