473,856 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

find test answers in JAVA/ source code

4 New Member
Hello,

I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer must be embedded somewhere in the source code, and I would like to know if anyone knows where to find the correct answer.

I would greatly appreciate it!!

Thanks!!

<!--put the preloads file here as it must load before the website class file.--><!--- String manipulation class for VCE
Properties
FixQuotes "string"

--->
<script language="javas cript">
function load2(form) {
//var url = form.Llist_1.op tions[form.Llist_1.se lectedIndex].value;
var url = "../view_course.asp ";
location.href = url;
return false;
}
function validate() {
if(document.Cou rseChooser.Llis t_1.options[document.Course Chooser.Llist_1 .selectedIndex].value=="")
{
window.alert(' Please Select Any course first.');
return false;
}
return true;
}
</script>

<SCRIPT>
<!--
function KIM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf ("?"))>0&&paren t.frames.length ) {
d=parent.frames[n.substring(p+1 )].document; n=n.substring(0 ,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.fo rms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.l ayers&&i<d.laye rs.length;i++) x=KIM_findObj(n ,d.layers[i].document);
if(!x && document.getEle mentById) x=document.getE lementById(n); return x;
}

function KIM_showHideLay ers() { //v3.0
var i,p,v,obj,args= KIM_showHideLay ers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=KIM_findO bj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?' visible':(v='hi de')?'hidden':v ; }
obj.visibility= v; }
}

function KIM_openBrWindo w(theURL,winNam e,features) { //v2.0
window.open(the URL,winName,fea tures);
}
//-->
</script>

<!--INCLUDE FILE="styles/kewl.css"-->
<script language="javas cript">
<!--
var win=null;
function NewWindow(mypag e,myname,w,h,sc roll,pos){
if(pos=="random "){LeftPosition =(screen.width) ?Math.floor(Mat h.random()*(scr een.width-w)):100;TopPosi tion=(screen.he ight)?Math.floo r(Math.random() *((screen.heigh t-h)-75)):100;}
if(pos=="center "){LeftPosition =(screen.width) ?(screen.width-w)/2:100;TopPositi on=(screen.heig ht)?(screen.hei ght-h)/2:100;}
else if((pos!="cente r" && pos!="random") || pos==null){Left Position=0;TopP osition=20}
settings='width ='+w+',height=' +h+',top='+TopP osition+',left= '+LeftPosition+ ',scrollbars='+ scroll+',locati on=no,directori es=no,status=no ,menubar=no,too lbar=no,resizab le=no';
win=window.open (mypage,myname, settings);
}
function openMedia(URL) {
window.open(URL ,'Multimedia_Ce nter','toolbar= no,location=no, directories=no, status=no,menub ar=no,resizable =no,copyhistory =no,scrollbars= no,width=500,he ight=500');
}

function openCompactMode (){
var m_compact
m_compact = window.open('/favourites/compact.html', m_compact, 'toolbar=no,wid th=180,height=4 50,resizable=1' );
m_compact.focus ();
}

function load1(form) {
var url = form.Llist_1.op tions[form.Llist_1.se lectedIndex].value;
location.href = url;
return false;
}

function popupMsg(msg) {
alert(msg);
}


function move_in(img_nam e,img_src){
document.images[img_name].src=img_src;
}

function move_out(img_na me,img_src){
document.images[img_name].src=img_src;
}

var myimages=new Array()
function preloadimages() {
for (i=0;i < preloadimages.a rguments.length ;i++){
myimages[i]=new Image()
myimages[i].src=preloadima ges.arguments[i]
}
}

function MM_openBrWindow (theURL,winName ,features) { //v2.0
window.open(the URL,winName,fea tures);
}

function MM_preloadImage s() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.leng th,a=MM_preload Images.argument s; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!= 0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf ("?"))>0&&paren t.frames.length ) {
d=parent.frames[n.substring(p+1 )].document; n=n.substring(0 ,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.fo rms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.l ayers&&i<d.laye rs.length;i++) x=MM_findObj(n, d.layers[i].document); return x;
}

function MM_showHideLaye rs() { //v3.0
var i,p,v,obj,args= MM_showHideLaye rs.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findOb j(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?' visible':(v='hi de')?'hidden':v ; }
obj.visibility= v; }
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_sw apImage.argumen ts; document.MM_sr= new Array; for(i=0;i<(a.le ngth-2);i+=3)
if ((x=MM_findObj( a[i]))!=null){docum ent.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgResto re() { //v3.0
var i,x,a=document. MM_sr; for(i=0;a&&i<a. length&&(x=a[i])&&x.oSrc;i++ ) x.src=x.oSrc;
}

//Validation for dropdown list
function Validate(theFor m)
{
if (theForm.Llist_ 1.selectedIndex == 0)
{
alert("The first option on the course menu is not a valid selection, rather it is an instruction for you to choose a course. The dropdown list contains the courses from which you must select one. Please Select your course before pressing GO. You may also use one of the filter links below the course list to change the list before selecting the course to enter.");
theForm.Llist_1 .focus();
return (false);
}
return (true);
}


// -->
</SCRIPT>

<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#FFFFF F" border="0"><tr> <td width="100%">
<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#FFFFF F" border="0"><tr> <td width="100%">

<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#1 11111" width="82%" id="AutoNumber2 ">

<tr>
<td valign="top" bgcolor="#5B90B 5" dir="ltr">
<table cellSpacing="0" cellPadding="0" border="0" bordercolor="#1 11111" align="center" width="100%">
<tr bgcolor="#FFFFF F" valign="top"><t d></td><td width="100%" align="center">

<SCRIPT language=JavaSc ript src="date-picker.js"></SCRIPT>
<script language="Javas cript">
<!--
{
//self.name="BODY ";
}

//DELETE QUESTION
function deleteQuestion( questionNo, testID)
{
if(confirm("You are going to delete this question.")){
window.navigate ("/tests/default.asp?act ion=deleteQuest ion&questionNo= " + questionNo + "&testID="+test ID);
}
}

// Mark the test
function markit()
{
MM_showHideLaye rs('taketest',' ','show')
var x = window.event.x
var y = window.event.y
if (navigator.appN ame=='Netscape' )
{
document.layers[taketest].top = y -50
document.layers[taketest].left = x- 100
}
else
{
document.all('t aketest').style .top =y -50
document.all('t aketest').style .left =x -100
}
}

// Validate the test form
function ValidateTest(th eForm)
{
if (theForm.questi onNo.selectedIn dex == 0)
{
alert("The first \"questionNo \" option is not a valid selection. Please choose one of the other options.");
theForm.questio nNo.focus();
return (false);
}
return (true);
}

// Validate the test chooser
function Validate(theFor m)
{
if (theForm.testID .selectedIndex == 0)
{
alert("The first \"testID\" option is not a valid selection. Please choose one of the other options.");
theForm.testID. focus();
return (false);
}
return (true);
}

// Validate the form for adding a test
function ValidateNewTest (theForm)
{
if (theForm.asscod e.selectedIndex == 0)
{
alert("The first \"asscode\" option is not a valid selection. Please choose one of the other options.");
theForm.asscode .focus();
return (false);
}
var checkOK = "0123456789-,";
var checkStr = theForm.percent age.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length ; i++)
{
ch = checkStr.charAt (i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt( j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter only digit characters in the \"percentage \" field.");
theForm.percent age.focus();
return (false);
}
return (true);
}

// --- expose the hidden layer for delete
function deleteitem(item id)
{
/*
MM_showHideLaye rs('deletethis' ,'','show')
var x = window.event.x
var y = window.event.y
if (navigator.appN ame=='Netscape' )
{
document.layers[deletethis].top = y -50
document.layers[deletethis].left = x- 10
}
else
{
document.all('d eletethis').sty le.top =y -50
document.all('d eletethis').sty le.left =x -10
}
//for (i=0;i<document .links.length;i ++) {
//alert (document.links[i].href + i);
//}
whereto = 'default.asp?ac tion=deletetest &record=' + itemid
document.links[95].href = whereto
*/
if (confirm("You are going to delete this test.\nAre you sure?")){
document.locati on = 'default.asp?ac tion=deletetest &record=' + itemid
}
}

// Validate mark active
function ValidateMarkAct ive(theForm)
{
if (theForm.assNo. selectedIndex == 0)
{
alert("The first \"assNo\" option is not a valid selection. Please choose one of the other options.");
theForm.assNo.f ocus();
return (false);
}
return (true);
}

//popup calendar
function calpopup(lnk) {
//window.open(lnk , "calendar","hei ght=250,width=2 50,scrollbars=n o")
}

//-->
</script>

<div id="taketest" style="position : absolute; left: 269; top: 109; width: 319; height: 102; z-index: 1; visibility: hidden"> <table cellpadding="5" cellspacing="0" bgcolor="#FFFF9 9" width="100%" border=0> <tr><td colspan="2"> <p align="center"> <font face="Verdana" size="2"><b> Are you sure you want to mark your test now. You will not be able to change your answers once it is graded.</b></font></td></tr> <tr><td><p align="center"> <font face="Verdana" size="2"><b><a onclick="MM_sho wHideLayers('ta ketest','','hid e')" href="#">No</a></b></font></td><td><p align="center"> <font face="Verdana" size="2"><b><a href="default.a sp?action=markm e&testID=oltest 7" >Yes</a></b></font></td></tr> </table></div><form method="POST" action="default .asp?action=sav eme&thisQuestio n=1&id=4159&Tes tID=oltest7"><b ><font color="#336600" >Question 1</b><br></font><br><table border=0><tr><t d>At the beginning of the play Macbeth is</td></tr></table> <br><Table width="100%" border="0"><tr> <td width="30"></TD><td></td></tr><tr><td valign=top><inp ut type="radio" name="myAnswer" value="1"> </td><td valign=top>A. Lord of Farres <br><tr><td valign=top><inp ut type="radio" name="myAnswer" value="2"> </td><td valign=top>B. Thane of Cawdor<br><br>< tr><td valign=top><inp ut type="radio" name="myAnswer" value="3"> </td><td valign=top>C. Thane of Glamis<br><br>< tr><td valign=top><inp ut type="radio" name="myAnswer" value="4"> </td><td valign=top>D. next one line to the throne <br><tr><td valign=top><tr> <td valign=top></Table><br><inpu t type="submit" class="button" value="Save answer" name="B1"><br> <a href="default.a sp?action=taket est&thisQuestio n=2&testID=olte st7"><IMG SRC="images/arrowRT1.gif" border="0" align="Middle" alt="Next"></A> <a href="default.a sp?action=taket est&thisQuestio n=10&testID=olt est7"><IMG SRC="images/arrowRFull1.gif " border="0" align="Middle" alt="Last"></A></form><hr>Select your answer choice by clicking inside one of small circles. When you are happy with your choice, click the <i>Save answer</i> button. <font color="red"><b> Click <IMG SRC="images/arrowRT1.gif" border="0" align="Middle" alt="Next"> to go to the next question</b></font>, or <IMG SRC="images/arrowlf1.gif" border="0" align="Middle" alt="Previous"> to go to the previous question. Click <IMG SRC="images/arrowRFull1.gif " border="0" align="Middle" alt="Last"> to go to the last question or <IMG SRC="images/arrowLFull1.gif " border="0" align="Middle" alt="First"> to go to the first question. <font color="red">Rem ember to save your answer before you move off this page</font>.</BODY>
</HTML><!-- End Putting Code For Main Win-->
</td></tr></table>

<tr bgcolor="#ff993 3">
<td width="100%" align="left" height="5">
<table width="100%" height="5" cellpadding="0" cellspacing="0" >
<tr><td width="30%" align="left" height="5">

<font color="#eeeeee" ><b>
Question: 1 of 10
</b></font>

</td>
<td width="70%" align="right" height="5">
<font color="#eeeeee" ><b>Attempt this quiz to continue.</b></font>

</td></tr></table>
</td></tr>


</table>
Sep 6 '07 #1
2 5092
Nepomuk
3,112 Recognized Expert Specialist
Expand|Select|Wrap|Line Numbers
  1. <!--put the preloads file here as it must load before the website class file.--><!--- String manipulation class for VCE 
  2.     Properties
  3.         FixQuotes "string"
  4.  
  5. --->
  6. <script language="javascript">
  7. ...
  8.  
If I'm not very mistaken, that means it's JavaScript, not Java. Those aren't the same! Please ask in the JavaScript/Ajax Forum.

Greetings,
Nepomuk
Sep 6 '07 #2
r035198x
13,262 MVP
If I'm not very mistaken, that means it's JavaScript, not Java. Those aren't the same! Please ask in the JavaScript/Ajax Forum.

Greetings,
Nepomuk
Moved to the Javascript forum.
Sep 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
47286
by: SubbaRao Karanam | last post by:
What does this error for the Code below java.io.StreamCorruptedException: invalid stream header at java.io.ObjectInputStream.readStreamHeader(Unknown Source) at java.io.ObjectInputStream.<init>(Unknown Source) at com.kbs.framework.client.gui.PIPReport.doProcess(PIPReport.java:562) at com.kbs.framework.client.gui.PIPReport.actionPerformed(PIPReport.java:508) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at...
0
15254
by: F. Da Costa | last post by:
Hi all, Although i'm not a complete newbie i do feel like one at the moment. This question concerns the use of the ResourceBundle as per the example in the Trail tutorial on java.sun.com (thus it should be simple, right?). The error: java.util.MissingResourceException: Can't find bundle for base name LabelsBundle, locale en_US
10
199274
by: dave | last post by:
I am reading input from a form. I want to validate the input by making sure that the string is actually an integer. How would I do this? Do i need to convert it to a character array and break down each character and test it? or is there an easier way? Thanks. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.720 / Virus Database: 476 - Release Date: 7/14/04
18
7743
by: jacksu | last post by:
I have a simple program to run xpath with xerces 1_2_7 XPathFactory factory = XPathFactory.newInstance(); XPath xPath = factory.newXPath(); XPathExpression xp = xPath.compile(strXpr); System.out.println(xp.evaluate(new InputSource(new FileInputStream("a.xml"))));
4
7078
by: PaperPilot | last post by:
I have a Java program that is deployed as a .jar file in which is another .jar file with the mysql library. Here is the appropriate section of code: /** * Makes the connection to the database. */ protected static Connection makeConnection() { try { Class.forName("org.gjt.mm.mysql.Driver");
4
5119
by: jingchua | last post by:
Hi, can anyone help out here???? I have the below error after compling the file. Any idea what is wrong in the declaration that was done in the above code??? Appreciate any help on shedding some light for this error on how to rectify it. C:\Documents and Settings\wei cheng\Desktop\aa1\test.java:122: cannot find symbol symbol : method objCompare(java.lang.Object,Person) location: class test if...
4
68327
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer must be embedded somewhere in the source code, and I would like to know if anyone knows where to find the correct answer. I would greatly appreciate it!! Thanks!!
2
6668
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double) Location: class Week5MortgageGUI Week5MortgageLogic allint = logic.allInterest(amount, term, rate); Week5MortgageGUI.java:152:cannot find symbol symbol: method allInterest(double,double,double) Location: class Week5MortgageGUI
10
13116
by: CodeNoob | last post by:
please help been working on a project got it down to 5 errors from 100 now i have no idea what to do. Errors: init: deps-jar: Created dir: C:\Users\Tommy\Desktop\build\classes Compiling 306 source files to C:\Users\Tommy\Desktop\build\classes C:\Users\Tommy\Desktop\PlasmaMS PET\SeanSource V.5.7\src\net\sf\odinms\provider\xmlwz\FileStoredPngMapleCanvas.java:14: warning: com.sun.imageio.plugins.png.PNGImageReaderSpi is Sun proprietary API...
0
9918
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9763
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10786
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10389
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9532
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7932
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5762
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5959
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4578
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.