git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C367
This commit is contained in:
parent
4f2a0a71a1
commit
23356103f3
1 changed files with 44 additions and 11 deletions
|
|
@ -5,9 +5,9 @@ var Titulo;
|
|||
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
|
||||
|
||||
getDataModel();
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
|
@ -23,8 +23,9 @@ this.getDataModel = function () {
|
|||
|
||||
this.CrearEncuesta = function (data) {
|
||||
var body = data.questions;
|
||||
|
||||
|
||||
var survey = new Survey.Survey();
|
||||
|
||||
survey.locale = "es";
|
||||
survey.title = data.DetalleEncuestas[0].EncabezadoEncuesta.Descripcion;
|
||||
survey.showProgressBar = "top";
|
||||
|
|
@ -34,7 +35,7 @@ this.CrearEncuesta = function (data) {
|
|||
$.each(body, function (key, item) {
|
||||
|
||||
if (key % 3 == 0)
|
||||
page = survey.addNewPage("page_"+ ( key + 1 ));
|
||||
page = survey.addNewPage("page_" + (key + 1));
|
||||
|
||||
|
||||
var q = page.addNewQuestion(item.type, item.title)
|
||||
|
|
@ -46,15 +47,47 @@ this.CrearEncuesta = function (data) {
|
|||
q.colCount = 3;
|
||||
}
|
||||
|
||||
if (item.type == "rating")
|
||||
{
|
||||
q.mininumRateDescription = item.RangoMinimo;
|
||||
q.maximumRateDescription = item.RangoMaximo;
|
||||
if (item.type == "rating") {
|
||||
q.minRateDescription = item.mininumRateDescription,
|
||||
q.maxRateDescription = item.maximumRateDescription
|
||||
}
|
||||
|
||||
if (item.type == "matrix") {
|
||||
|
||||
|
||||
//q.columns = [];
|
||||
$.each(item.columns, function (index, columna) {
|
||||
|
||||
q.columns.value = columna;
|
||||
q.columns.text = columna;
|
||||
//var columna = { value: columna, text: columna };
|
||||
//q.columns.push(columna);
|
||||
});
|
||||
|
||||
//q.rows = [];
|
||||
$.each(item.rows, function (index, fila) {
|
||||
q.rows.value = fila;
|
||||
q.rows.text = fila;
|
||||
//var fila = { value: fila, text: fila };
|
||||
//q.rows.push(fila);
|
||||
});
|
||||
}
|
||||
|
||||
q.name = item.name;
|
||||
q.isRequired = item.Requerido == true;
|
||||
|
||||
|
||||
});
|
||||
//var q = page.addNewQuestion("matrix", "Por favor indique su nivel de satisfacción con las siguintes preguntas")
|
||||
// q.columns = [
|
||||
// { value: 1, text: "Totalmente desacuerdo" },
|
||||
// { value: 2, text: "Desacuerdo" }
|
||||
// ],
|
||||
// q.rows = [
|
||||
// { value: "affordable", text: "Fácil de usar" },
|
||||
// { value: "does what it claims",text: "Mejor que los demás"}
|
||||
// ]
|
||||
|
||||
|
||||
|
||||
$("#surveyElement").Survey({
|
||||
model: survey
|
||||
|
|
@ -131,7 +164,7 @@ this.CrearEncuesta = function (data) {
|
|||
// title: "Digite un comentario"
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
|
|
@ -217,7 +250,7 @@ this.CrearEncuesta = function (data) {
|
|||
// ]
|
||||
// };
|
||||
|
||||
|
||||
|
||||
//if (!window["%hammerhead%"]) {
|
||||
// init();
|
||||
//}
|
||||
Loading…
Add table
Reference in a new issue