Jump to content

rowimo

Members
  • Posts

    3
  • Joined

  • Last visited

rowimo's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. My site conducts a training exam that ultimately after completion (with a passing grade), the user should be able to print a completion certificate. I have read the earlier posts on how to create a background image but I still have a few problems. Quick Background: - The actual certificate is landscape and should fill a whole page with a blank 1" border. - The image is located on my website (hidden page) for the report to reference. - The style I currently use is set up with a table width of 1200px (List/Grid Layout) with equal column width checked. - The Details Page is setup with a section that has 3 columns with 3 HTML blocks. - There is a field in the first HTML block to fill a place in the lower left side of the certificate. - There are 3 fields in the next HTML block (middle) to center the remaining information in the center or the certificate. - There is a 3rd HTML block that contains a number of "&nbsp:" to expand the third column - The image will occasionally shrink. - Style/Forms/Details/layout source information is as follows: .cbFormTable { /*Form Table Attributes*/ border-collapse: collapse; background-image: url("http://www.xxxx.com/xxxxxxxx/Icon_Page_files/droppedImage_4.png"); background-repeat: no-repeat; Question 1: - Can I load the image in my caspio account and have my "style" reference it from there versus the earlier posting which suggested that it be referenced from someplace on the web? - If I can place the image in my caspio file location, how would I reference it? Question 2: - Can I control/specify the size of the image? - If so, how? I would love to hear any ideas. Best Regards,
  2. Thank you for your post. I actually resolved it last night in a similar fashion and added a little logic to acknowledge whether the person passed or failed and render a status to determine whether or not they could print a completion certificate. Hopefully this can help others as well. The script is below and still includes my alerts to identify any problem spots: function calculate() { var Question1 = 0; if(document.getElementById('InsertRecordQuestion11').checked) { Question1 = 1; } var Question2 = 0; if(document.getElementById('InsertRecordQuestion21').checked) { Question2 = 1; } var Question3 = 0; if(document.getElementById('InsertRecordQuestion32').checked) { Question3 = 1; } var Question4 = 0; if(document.getElementById('InsertRecordQuestion44').checked) { Question4 = 1; } var Question5 = 0; if(document.getElementById('InsertRecordQuestion51').checked) { Question5 = 1; } var Question6 = 0; if(document.getElementById('InsertRecordQuestion60').checked) { Question6 = 1; } var Question7 = 0; if(document.getElementById('InsertRecordQuestion71').checked) { Question7 = 1; } var Question8 = 0; if(document.getElementById('InsertRecordQuestion81').checked) { Question8 = 1; } var Question9 = 0; if(document.getElementById('InsertRecordQuestion92').checked) { Question9 = 1; } var Question10 = 0; if(document.getElementById('InsertRecordQuestion100').checked) { Question10 = 1; } var Question11 = 0; if(document.getElementById('InsertRecordQuestion112').checked) { Question11 = 1; } var Question12 = 0; if(document.getElementById('InsertRecordQuestion122').checked) { Question12 = 1; } alert("Before Sum"); var sum = (Question1 + Question2 + Question3 + Question4 + Question5 + Question6 + Question7 + Question8 + Question9 + Question10 + Question11 + Question12); alert("After Sum"); document.getElementById('InsertRecordSum').value = Math.round(sum); var total = 12; alert("Before Result"); var result = (sum / total); alert("After Result"); document.getElementById('InsertRecordResult').value = Math.round(result*100)/100; (document.getElementById('InsertRecordSum').value); alert("Before Status"); var status = "Failed"; if( result >= .85 ) { status = "PASSED"; } document.getElementById('InsertRecordStatus').value = (status); alert("Afer Status"); } document.getElementById("caspioform").onsubmit=calculate; Best Regards.
  3. Hello- I have a web form to conduct a training exam. Problem - My script (below) when run posts the sum of the the correct answer whether or not it was chosen - It has 12 questions and the answers are displayed as radio buttons. - Each field is labeled Question1, Question2......Question12 - The correct answer for each question has a value of "1" and the incorrect answer has a value of "0". - At the conclusion of the exam, I have created a button that the user can click to grade the exam. The button script is as follows: Problem - This script when run posts the sum in the correct field but it currently sums up the correct answers for each question regardless of whether or not they were the chosen answer. - The calculate function is as follows: function calculate() { var v_Question1 = document.getElementById('InsertRecordQuestion11'); var Question1 = parseFloat( v_Question1.value ,10 ); var v_Question2 = document.getElementById('InsertRecordQuestion21'); var Question2 = parseFloat( v_Question2.value ,10 ); var v_Question3 = document.getElementById('InsertRecordQuestion32'); var Question3 = parseFloat( v_Question3.value ,10 ); var v_Question4 = document.getElementById('InsertRecordQuestion44'); var Question4 = parseFloat( v_Question4.value ,10 ); var v_Question5 = document.getElementById('InsertRecordQuestion51'); var Question5 = parseFloat( v_Question5.value ,10 ); var v_Question6 = document.getElementById('InsertRecordQuestion60'); var Question6 = parseFloat( v_Question6.value ,10 ); var v_Question7 = document.getElementById('InsertRecordQuestion71'); var Question7 = parseFloat( v_Question7.value ,10 ); var v_Question8 = document.getElementById('InsertRecordQuestion81'); var Question8 = parseFloat( v_Question8.value ,10 ); var v_Question9 = document.getElementById('InsertRecordQuestion92'); var Question9 = parseFloat( v_Question9.value ,10 ); var v_Question10 = document.getElementById('InsertRecordQuestion100'); var Question10 = parseFloat( v_Question10.value ,10 ); var v_Question11 = document.getElementById('InsertRecordQuestion112'); var Question11 = parseFloat( v_Question11.value ,10 ); var v_Question12 = document.getElementById('InsertRecordQuestion122'); var Question12 = parseFloat(v_Question12.value ,10); var sum = (Question1 + Question2 + Question3 + Question4 + Question5 + Question6 + Question7 + Question8 + Question9 + Question10 + Question11 + Question12); document.getElementById('InsertRecordSum').value = Math.round(sum); (document.getElementById('InsertRecordSum').value); } Any help would be greatly appreciated...
×
×
  • Create New...