Review test

4,054 Kb

How do I make an review test?

Test of review. What is a review test? How do you make a review test? This script and codes were developed by Jorman Fernandez on 09 November 2022, Wednesday.

Review test Previews

Review test - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Review test</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/style.css">
<body> <html> <body> <div class="box"> <p>Rating test</p> <p>Solo de muestra</p> <hr> <span>Review</span> <select> <option>10</option> <option>9</option> <option>8</option> <option>7</option> <option>6</option> <option>5</option> <option>4</option> <option>3</option> <option>2</option> <option>1</option> </select> <br> <textarea placeholder="Escribe tu review"></textarea> <span class="tt"></span> <br> <input type="button" value="Enviar review"> <hr> <div class="review_desc"> <p class="val_g"></p> <p><u>LISTADO DE REVIEWS</u></p> <table> <tr class="header"> <td><b>Review</b></td> <td><b>Valoración</b></td> <td><b>Descripción</b></td><div class="elements"></div> </tr> </table> <br> </div> <br> </div> </body>
</html> <script src=''></script> <script src="js/index.js"></script>

Review test - Script Codes CSS Codes

body{ background-color: #eee;
}{ left:0; right:0; margin:auto; position: relative; width: 1000px; text-align: center; background-color: white; -webkit-box-shadow: 0px 0px 3px 0px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 3px 0px rgba(0,0,0,0.75);
box-shadow: 0px 0px 3px 0px rgba(0,0,0,0.75);
hr{ width: 70%;
textarea{ margin-top: 5px; margin-bottom: 5px; width: 400px; height: 200px;
div.review_desc{ width: 600px; left: 0; right: 0; margin: auto; border: 1px solid black; padding-left: 5px; padding-rigth: 5px; padding-bottom: 5px;
span.left{ clear: left; float: left;
input[type="button"]{ border: 1px solid black; cursor: pointer; background-color: white; transition: 0.2s all;
input[type="button"]:hover{ background-color: black; color: white;
table{ max-width: 550px; left: 0; right: 0; position: relative; margin: auto; border-collapse: collapse;
table td{ padding: 5px; border: 1px solid black;
table tr.header td{ background-color: #eee;
p.val_g span{ text-decoration: initial; background-color: #eee; padding: 5px; -webkit-box-shadow: 0px 0px 3px 0px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 3px 0px rgba(0,0,0,0.75);
box-shadow: 0px 0px 3px 0px rgba(0,0,0,0.75);
}{ margin-left: 3px;
table span{ float: left; font-size: 100%;
span.edit{ cursor: pointer; color: blue; font-weight: bold; font-size: 14px;

Review test - Script Codes JS Codes

var mes_n = [ "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
var textarea = document.getElementsByTagName("textarea")[0];
var review_box = document.getElementsByTagName("table")[0];
var send_input = document.getElementsByTagName("input")[0];
var review_val;
var p_reviews= [7,10,3];
var total="";
var f_reviews = ["26 de Octubre de 2013 | 3:26:51 PM","13 de Febrero de 2016 | 10:20:32 AM","11 de Junio de 1994 | 10:58:11 PM"];
var reviews = ["Buen servicio","Un servicio de 10","Muy lento"];
//send review
var desc_rev = document.getElementsByTagName("textarea")[0].value;
review_val= parseInt(document.getElementsByTagName("select")[0].value);
var date = new Date();
var dia = date.getDate();
var mesI = date.getMonth();
var ano = date.getFullYear();
var h = date.getHours() % 12 || 12;
var m = rcero(date.getMinutes());
var s = rcero(date.getSeconds());
var t;
if(date.getHours()>11 && date.getHours()<24){ t = "PM";
}else{ t = "AM";
var f_rev = dia+" de "+mes_n[mesI]+" de "+ano+" | " + h +":"+m+":"+s+" "+t; //clean fields document.getElementsByTagName("select")[0].value=10; //----------- send_reviews(review_val,desc_rev,f_rev.toString()); textarea.value="";
//function enviar review
function send_reviews(valor_review,desc_review,fecha){ if(valor_review=="" || desc_review=="" || isNaN(valor_review)){ alert("Revise que los campos sean correctos"); }else{ var i=p_reviews.length; p_reviews[i]=valor_review; reviews[i]=desc_review; f_reviews[i]=fecha; c_review(); show_revs(1,p_reviews[i],reviews[i],f_reviews[i]); $('body,html').animate({ scrollTop: $('body').height()}, 500); }
//function sacar porcentaje
function c_review(){ if(p_reviews.length!=reviews.length){$(".val_g").html("No se pudo cargar las reviews");}else{total=0; for(var i=0; p_reviews.length>i;i++){ total = parseInt(total+p_reviews[i]); } total = total/parseInt(p_reviews.length*10); total = total*10; $(".val_g").html("<p><b><u>Valoración general</u></b></p><span>"+p_reviews.length+" valoraciones | "+total.toFixed(2)+" / 10</span>"); }
//function mostrar reviews
function show_revs(loaded,update,rev_val,rev_desc,rev_fecha){ if(p_reviews.length!=reviews.length){$(review_box).append("<tr><td></td><td><span>No se pudo contactar con la base de datos</span></td><td></td></tr>");}else{if(!loaded){ for(var i=0;p_reviews.length>i;i++){ $(review_box).append("<tr><td class=\"review\"><span title=\"Fecha: "+f_reviews[i]+"\">#"+parseInt(i+1)+" | "+f_reviews[i]+"</span></td><td><span> "+p_reviews[i]+" / 10 </span></td><td><span>"+reviews[i]+"</span></td><td><span class=\"edit\" id=\""+i+"\" title=\"Editar\">i</span></td></tr>"); } }else{ $(review_box).append("<tr><td class=\"review\"><span title=\"Fecha: "+rev_fecha+"\" >#"+parseInt(p_reviews.length)+" | "+rev_fecha+"</span></td><td><span>"+rev_val+" / 10 </span></td><td><span>"+rev_desc+"</span></td><td><span class=\"edit\" title=\"Editar\" id=\""+p_reviews.length+"\">i</span></td></tr>"); }
} }
var tt=document.getElementsByClassName("tt");
jQuery(document).ready(function($) { var max = 130; $(textarea).keypress(function(e) { if (e.which < 0x20) { $(textarea).keyup(function(){ if(max-$(textarea).val().length < 20){ $(tt).html(max-$(textarea).val().length);} }); } if (this.value.length == max) { e.preventDefault(); } else if (this.value.length > max) { // Maximum exceeded this.value = this.value.substring(0, max); } $(textarea).keyup(function(){ if(max-$(textarea).val().length < 20){ $(tt).html(max-$(textarea).val().length);} }); });
function rcero(x){ if (x < 10) { x = "0" + x; } return x;
function edit_rev(x){ var d_rev=prompt("Editar descripción de review",reviews[x]); if(d_rev==""||d_rev == " " ||d_rev === null){ alert("No he sa hecho la modificación"); return d_rev; }else{ var p_rev p_rev=prompt("Valore de nuevo. Solo del 1 al 10",parseInt(p_reviews[x])); if(p_rev < 1 || p_rev > 10 || isNaN(p_rev) || p_rev === null){ alert("No he sa hecho la modificación"); return p_rev; }else{ reviews[x]= d_rev; p_reviews[x]= p_rev; $(review_box).html(""); console.log("Clean Elements"); show_revs(0); } }
$(document).on("click", ".edit", function(){ //edit_rev( parseInt( $(this).attr("id") ) );
Review test - Script Codes
Review test - Script Codes
Home Page Home
Developer Jorman Fernandez
Username otro_user_gil
Uploaded November 09, 2022
Rating 3
Size 4,054 Kb
Views 10,120
Do you need developer help for Review test?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Jorman Fernandez (otro_user_gil) Script Codes
Create amazing love letters with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!