Commit d0622c20 authored by Frank Bergmann's avatar Frank Bergmann

Initial Import

parents
<?xml version="1.0"?>
<!-- Generated by the OpenACS Package Manager -->
<package key="intranet-trans-project-feedback" url="http://openacs.org/repository/apm/packages/intranet-trans-project-feedback" type="apm_application">
<package-name>]project-open[ Translation Project Feedback</package-name>
<pretty-plural>]project-open[ Translation Project Feedback</pretty-plural>
<initial-install-p>f</initial-install-p>
<singleton-p>t</singleton-p>
<implements-subsite-p>f</implements-subsite-p>
<inherit-templates-p>t</inherit-templates-p>
<auto-mount>intranet-trans-project-feedback</auto-mount>
<version name="0.1d" url="http://openacs.org/repository/download/apm/intranet-trans-project-feedback-0.1d.apm">
<owner url="mailto:klaus.hofeditz@project-open.com">System Administrator</owner>
<owner>mailto:frank.bergmann@project-open.com</owner>
<summary>Managing and evaluate feedback on Translation Projects</summary>
<vendor url="www.project-open.com">Project Open Business Solutions S.L.</vendor>
<description format="text/html">Provides a portlet to track feedback on Translation Projects plus some graphs and reports </description>
<maturity>0</maturity>
<provides url="intranet-trans-project-feedback" version="0.1d"/>
<callbacks>
</callbacks>
<parameters>
<!-- No version parameters -->
</parameters>
</version>
</package>
<if @report_code_found_p@>
<div id=@diagram_id@></div>
<script type='text/javascript'>
Ext.require(['Ext.chart.*', 'Ext.Window', 'Ext.fx.target.Sprite', 'Ext.layout.container.Fit']);
Ext.onReady(function () {
// ////////////////////////////////////////////////
// STORES
//
var translationProjectFeedbackNonComformityStore = Ext.create('Ext.data.Store', {
fields: [
{ name: 'first_day_period', type: 'string'},
{ name: 'number_projects', type: 'int'},
{ name: 'number_projects_non_conform', type: 'int'},
{ name: 'percentage_non_conform', type: 'int'}
],
autoLoad: true,
proxy: {
type: 'rest',
url: '/intranet-reporting/view', // This is the generic ]po[ REST interface
extraParams: {
format: 'json', // Ask for data in JSON format
limit: @diagram_limit@, // Limit the number of returned rows
report_code: '@diagram_report_code@', // The code of the data-source to retreive
start_date: '@start_date@',
end_date: '@end_date@',
period: '@period@'
},
reader: { type: 'json', root: 'data' } // Standard reader: Data are prefixed by "data".
}
});
var translationProjectFeedbackNonComformityProportionStore = Ext.create('Ext.data.Store', {
fields: [
{ name: 'choice', type: 'string' },
{ name: 'count', type: 'int'}
],
autoLoad: true,
proxy: {
type: 'rest',
url: '/intranet-reporting/view', // This is the generic ]po[ REST interface
extraParams: {
format: 'json', // Ask for data in JSON format
limit: @diagram_limit@, // Limit the number of returned rows
report_code: '@diagram_report_code@', // The code of the data-source to retreive
start_date: '@start_date@',
end_date: '@end_date@',
period: '@period@'
},
reader: { type: 'json', root: 'data' } // Standard reader: Data are prefixed by "data".
}
});
// ////////////////////////////////////////////////
// CHART TYPES
//
<if @chart_type@ eq "column_chart">
var ticketAgingChart = new Ext.chart.Chart({
xtype: 'chart',
width: @diagram_width@,
height: @diagram_height@,
title: '@diagram_title@',
renderTo: '@diagram_id@',
layout: 'fit',
animate: true,
shador: true,
store: @store@,
insetPadding: @diagram_inset_padding@,
// theme: '@diagram_theme@',
axes: [{
type: 'category',
position: 'bottom',
fields: ['first_day_period'],
label: { font: '@diagram_font@' },
// title: 'Number of tickets',
grid: false,
minimum: 0
}, {
type: 'Numeric',
position: 'left',
fields: ['number_projects'],
label: { font: '@diagram_font@' },
// title: 'Age of tickets (days)',
minimum: 0
}],
series: [{
type: 'column',
axis: 'left',
title: [ 'Total Projects', 'Projects not conform'],
xField: 'first_day_period',
yField: [ 'number_projects', 'number_projects_non_conform' ],
style: {
opacity: 0.80
},
tips: {
trackMouse: false,
width: @diagram_tooltip_width@,
height: @diagram_tooltip_height@
}
}],
legend: {
position: 'right',
labelFont: '@diagram_font@'
}
});
</if>
<elseif @chart_type@ eq "pie_chart">
chart = new Ext.chart.Chart({
width: @diagram_width@,
height: @diagram_height@,
animate: true,
store: @store@,
renderTo: '@diagram_id@',
shadow: true,
legend: {
position: 'right'
},
insetPadding: 25,
theme: 'Base:gradients',
series: [{
type: 'pie',
field: 'count',
showInLegend: true,
highlight: {
segment: {
margin: 20
}
},
label: {
field: 'choice',
display: 'rotate',
contrast: true,
font: '11px "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif',
renderer: function(val, label, storeItem, item, i, display, animate, index) {
var sumNonComformityProjects = translationProjectFeedbackNonComformityProportionStore.sum('count');
// console.log('sumNonComformityProjects:' + sumNonComformityProjects);
// console.log('val:' + val);
// console.log('count:' + storeItem.get('count'));
var ret = (parseFloat(storeItem.get('count') / sumNonComformityProjects) * 100.0).toFixed(2) + '%';
return ret + ' ' + val.substring(0,20);
}
},
animate: true
}]
});
</elseif>
<elseif @chart_type@ eq "line_chart">
chart = new Ext.chart.Chart({
renderTo: @diagram_id@,
width: @diagram_width@,
height: @diagram_height@,
animate: true,
store: @store@,
shadow: true,
theme: 'Category1',
legend: {
position: 'right'
},
axes: [{
type: 'Numeric',
minimum: 0,
position: 'left',
fields: ['percentage_non_conform'],
// title: 'Number of Hits',
grid: {
odd: {
opacity: 1,
fill: '#ddd',
stroke: '#bbb',
'stroke-width': 0.5
}
}
}, {
type: 'Category',
position: 'bottom',
fields: ['first_day_period'],
label: { font: '@diagram_font@' },
// title: ''
}],
series: [{
type: 'line',
highlight: {
size: 7,
radius: 7
},
axis: 'left',
xField: 'first_day_period',
yField: 'percentage_non_conform',
label: {
display: 'under',
field: 'percentage_non_conform',
minMargin: 200,
padding: 30,
font: '16px Helvetica, sans-serif',
renderer: function(val, label, storeItem, item, i, display, animate, index) {
return storeItem.get('percentage_non_conform') + '%';
}
}
}]
});
</elseif>
});
</script>
</if>
<else>
<%=[lang::message::lookup "" intranet-trans-project-feedback.CodeNotFound "No DataSource found for title: '$title', please check your Portlet Parameters"]%>
</else>
# /packages/intranet-trans-project-feedback/www/graph-panel.tcl
#
# Copyright (C) 2015 Project Open Business Solutions S.L.
#
# This program is free software. You can redistribute it
# and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation;
# either version 2 of the License, or (at your option)
# any later version. This program is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
# Profiles represent OpenACS groups used by ]project-open[
# However, for performance reasons we have introduced special
# caching and auxillary functions specific to ]po[.
# @author klaus.hofeditz@project-open.com
# ---------------------------------------------------------------------------
# DEFAULTS & PERMISSIONS
# ---------------------------------------------------------------------------
# Provided:
# title
# start_date
# end_date
# period
set current_url [ns_conn url]
set current_user_id [ad_maybe_redirect_for_registration]
set package_url "/simple-survey"
set report_code_found_p 1
if ![info exists return_url] { set return_url "/intranet-trans-project-feedback/dashboard" }
# Set Report Code
switch $title {
"Non Comformity" {
set store "translationProjectFeedbackNonComformityStore"
set chart_type "column_chart"
set diagram_report_code "translation_project_feedback_non_comformity"
if {![info exists diagram_width] || "" == $diagram_width} { set diagram_width 600 }
if {![info exists diagram_height] || "" == $diagram_height } { set diagram_height 350 }
if {![info exists diagram_font] || "" == $diagram_font} { set diagram_font "10px Helvetica, sans-serif" }
if {![info exists diagram_theme] || "" == $diagram_theme} { set diagram_theme "Custom" }
if {![info exists diagram_limit] || "" == $diagram_limit} { set diagram_limit 100 }
if {![info exists diagram_inset_padding] || "" == $diagram_inset_padding} { set diagram_inset_padding 5 }
if {![info exists diagram_tooltip_width] || "" == $diagram_tooltip_width} { set diagram_tooltip_width 230 }
if {![info exists diagram_tooltip_height] || "" == $diagram_tooltip_height} { set diagram_tooltip_height 20 }
if {![info exists diagram_legend_width] || "" == $diagram_legend_width} { set diagram_legend_width 150 }
if {![info exists diagram_title] || "" == $diagram_title} { set diagram_title [lang::message::lookup "" intranet-trans-project-feedback.$title $title] }
set diagram_id "translation_project_feedback_non_comformity"
}
"Non-Comformity - Proportions" {
set store "translationProjectFeedbackNonComformityProportionStore"
set chart_type "pie_chart"
set diagram_report_code "translation_project_feedback_non_comformity_proportions"
if {![info exists diagram_limit] || "" == $diagram_limit} { set diagram_limit 100 }
if {![info exists diagram_width] || "" == $diagram_width} { set diagram_width 800 }
if {![info exists diagram_height] || "" == $diagram_height } { set diagram_height 350 }
set diagram_id "translation_project_feedback_non_comformity_proportions"
}
"Conformity vs Non-Comformity" {
if {![info exists diagram_font] || "" == $diagram_font} { set diagram_font "10px Helvetica, sans-serif" }
set store "translationProjectFeedbackNonComformityStore"
set chart_type "line_chart"
set diagram_report_code "translation_project_feedback_non_comformity"
if {![info exists diagram_limit] || "" == $diagram_limit} { set diagram_limit 100 }
if {![info exists diagram_width] || "" == $diagram_width} { set diagram_width 600 }
if {![info exists diagram_height] || "" == $diagram_height } { set diagram_height 350 }
set diagram_id "translation_project_feedback_comformity_vs_non_comformity"
}
default {
set report_code_found_p 0
}
}
# ---------------------------------------------------------------------------
# Loading ExtJS libs
im_sencha_extjs_load_libraries
<form action="/intranet-trans-project-feedback/process-response" method="POST">
<input type="hidden" name="survey_id" value="@survey_id@" />
<input type="hidden" name="return_url" value="@return_url@" />
<input type="hidden" name="related_object_id" value="@project_id@" />
<input type="hidden" name="related_context_id" value="@current_user_id@" />
@html;noquote@
<input type="submit" value="@button_label@">
</form>
# /packages/intranet-trans-project-feedback/lib/survey-component.tcl
#
# Copyright (C) 2015 Project Open Business Solutions S.L.
#
# This program is free software. You can redistribute it
# and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation;
# either version 2 of the License, or (at your option)
# any later version. This program is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
# Profiles represent OpenACS groups used by ]project-open[
# However, for performance reasons we have introduced special
# caching and auxillary functions specific to ]po[.
# @author klaus.hofeditz@project-open.com
# @author philg@mit.edu
# @author nstrug@arsdigita.com
# ---------------------------------------------------------------------------
# DEFAULTS & PERMISSIONS
# ---------------------------------------------------------------------------
set current_url [ns_conn url]
set current_user_id [ad_maybe_redirect_for_registration]
set package_url "/simple-survey"
if { ![info exists return_url] || ""==$return_url } { set return_url "/intranet/projects/view?project_id=$project_id" }
im_project_permissions $current_user_id $project_id view read write admin
if {!$read} { return "" }
set survey_id [db_string get_data "select survey_id from survsimp_surveys where name = 'Project Translation Feedback'" -default 0]
if { 0 == $survey_id } {return [lang::message::lookup "" intranet-trans-project-feedback.SurveyNotFound "Survey 'Project Translation Feedback' not found"] }
# ad_require_permission $survey_id survsimp_take_survey
# ---------------------------------------------------------------------------
# Show Survey
# ---------------------------------------------------------------------------
db_1row survey_info "
select
name,
description,
single_response_p,
single_editable_p,
display_type
from
survsimp_surveys
where
survey_id = :survey_id"
set context [list [list "./" "Surveys"] "$name"]
set num_responses [db_string responses_count {
select count(response_id)
from survsimp_responses, acs_objects
where response_id = object_id
and survey_id = :survey_id
}]
if {$single_response_p == "t"} {
if {$num_responses == "0"} {
set button_label "Submit response"
set edit_previous_response_p "f"
} else {
set button_label "Modify submited response"
set edit_previous_response_p "t"
}
set previous_responses_link ""
} else {
set button_label "Submit response"
set edit_previous_response_p "f"
if {$num_responses == "0"} {
set previous_response_p "f"
} else {
set previous_response_p "t"
}
}
if {$single_response_p == "t" && $single_editable_p == "f"} {
set modification_allowed_p "f"
} else {
set modification_allowed_p "t"
}
# build a list containing the HTML (generated with survsimp_question_display) for each question
set rownum 0
set questions [list]
db_foreach question_ids_select {
select question_id
from survsimp_questions
where survey_id = :survey_id
and active_p = 't'
order by sort_key
} {
append html "[survsimp_question_display_trans_feedback $question_id $project_id $edit_previous_response_p]<br/><br/>"
}
This diff is collapsed.
-- /packages/intranet-trans-project-feedback/sql/postgres/intranet-trans-project-feedback-create.sql
--
-- Copyright (C) 2011-2015 ]project-open[
--
-- This program is free software. You can redistribute it
-- and/or modify it under the terms of the GNU General
-- Public License as published by the Free Software Foundation;
-- either version 2 of the License, or (at your option)
-- any later version. This program is distributed in the
-- hope that it will be useful, but WITHOUT ANY WARRANTY;
-- without even the implied warranty of MERCHANTABILITY or
-- FITNESS FOR A PARTICULAR PURPOSE.
-- See the GNU General Public License for more details.
--
-- @author klaus.hofeditz@project-open.com
CREATE OR REPLACE FUNCTION inline_0 ()
RETURNS INTEGER AS $BODY$
declare
v_count integer;
v_package_id integer;
v_survey_id integer;
r record;
foo integer;
begin
select survey_id into v_survey_id from survsimp_surveys where name = 'Project Translation Feedback';
FOR r IN select question_id from survsimp_questions where survey_id = v_survey_id
LOOP
-- rm response questions
delete from survsimp_question_responses where question_id = r.question_id;
-- rm questions
PERFORM survsimp_question__delete(r.question_id);
END LOOP;
-- rm response item
delete from survsimp_responses where survey_id = v_survey_id;
-- rm survey
delete from acs_object_context_index where ancestor_id = v_survey_id;
delete from acs_object_context_index where object_id = v_survey_id;
delete from acs_objects where context_id = v_survey_id;
PERFORM survsimp_survey__delete(v_survey_id);
return 0;
exception when others then
raise notice 'Unable to remove package:';
raise notice '% %', SQLERRM, SQLSTATE;
return 1;
end;$BODY$ LANGUAGE 'plpgsql';
SELECT inline_0 ();
DROP FUNCTION inline_0 ();
-- Delete REST reports
delete from im_reports where report_code = 'translation-project-feedback-non-comformity';
delete from im_reports where report_code = 'translation_project_feedback_non_comformity_proportions';
This diff is collapsed.
<master>
<property name="title">@page_title@</property>
<property name="main_navbar_label">projects</property>
<property name="left_navbar">@left_navbar_html;noquote@</property>
<h1><%=[lang::message::lookup "" intranet-trans-project-feedback.DashboardProjectFeedback "Dashboard Project Feedback"]%></h1>
<%= [im_component_bay top] %>
<table cellpadding=0 cellspacing=0 border=0 width="100%">
<tr>
<td valign=top width='50%'>
<%= [im_component_bay left] %>
</td>
<td width=2>&nbsp;</td>
<td valign=top>
<%= [im_component_bay right] %>
</td>
</tr>
</table><br>
<table cellpadding=0 cellspacing=0 border=0 width='100%'>
<tr><td>
<!-- Bottom Component Bay -->
<%= [im_component_bay bottom] %>
</td></tr>
</table>
# /packages/intranet-trans-project-feedback/www/dashboard.tcl
#
# Copyright (C) 2015 Project Open Business Solutions S.L.
#
# This program is free software. You can redistribute it
# and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation;
# either version 2 of the License, or (at your option)
# any later version. This program is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
# Profiles represent OpenACS groups used by ]project-open[
# However, for performance reasons we have introduced special
# caching and auxillary functions specific to ]po[.
# @author klaus.hofeditz@project-open.com
ad_page_contract {
Shows dashboard for Translation Project Feedback
@author mbryzek@arsdigita.com
@author Frank Bergmann (frank.bergmann@project-open.com)
@author klaus.hofeditz@project-open.com
} {
{ start_date "" }
{ end_date "" }
{ period "" }
}
# ---------------------------------------------------------------------
# Permissions
# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
# Defaults & Security
# ---------------------------------------------------------------------
set show_context_help_p 0
set user_id [ad_maybe_redirect_for_registration]
set return_url [im_url_with_query]
set current_url [ns_conn url]
set site_wide_admin_p [im_is_user_site_wide_or_intranet_admin $user_id]
set page_title ""
set left_navbar_html ""
set admin_html_content ""
db_1row todays_date "
select
to_char(sysdate::date, 'YYYY') as todays_year,
to_char(sysdate::date, 'MM') as todays_month,
to_char(sysdate::date, 'DD') as todays_day
from dual
"
# Show last 6 months by default
if {"" == $end_date} { set end_date "$todays_year-$todays_month-01" }
if {"" == $start_date} { set start_date [clock format [clock scan {-6 months} -base [clock scan $end_date] ] -format %Y-%m-%d] }
if { "" == $period } {
set period "month"
}
# ---------------------------------------------------------------------
# Validate
# ---------------------------------------------------------------------
if { "" != $start_date } {
if {[catch {
if { $start_date != [clock format [clock scan $start_date] -format %Y-%m-%d] } {
ad_return_complaint 1 "<strong>[_ intranet-core.Start_Date]</strong> [lang::message::lookup "" intranet-core.IsNotaValidDate "is not a valid date"].<br>
[lang::message::lookup "" intranet-core.Current_Value "Current value"]: '$start_date'<br>"
}
} err_msg]} {
ad_return_complaint 1 "<strong>[_ intranet-core.Start_Date]</strong> [lang::message::lookup "" intranet-core.DoesNotHaveRightFormat "doesn't have the right format"].<br>
[lang::message::lookup "" intranet-core.Current_Value "Current value"]: '$start_date'<br>
[lang::message::lookup "" intranet-core.Expected_Format "Expected Format"]: 'YYYY-MM-DD'"
}
}
if { "" != $end_date } {
if {[catch {
if { $end_date != [clock format [clock scan $end_date] -format %Y-%m-%d] } {
ad_return_complaint 1 "<strong>[_ intranet-core.End_Date]</strong> [lang::message::lookup "" intranet-core.IsNotaValidDate "is not a valid date"].<br>
[lang::message::lookup "" intranet-core.Current_Value "Current value"]: '$end_date'<br>"
}
} err_msg]} {
ad_return_complaint 1 "<strong>[_ intranet-core.End_Date]</strong> [lang::message::lookup "" intranet-core.DoesNotHaveRightFormat "doesn't have the right format"].<br>
[lang::message::lookup "" intranet-core.Current_Value "Current value"]: '$end_date'<br>
[lang::message::lookup "" intranet-core.Expected_Format "Expected Format"]: 'YYYY-MM-DD'"
}
}
# ---------------------------------------------------------------------
# Admin Box
# ---------------------------------------------------------------------
set sel_month ""
set sel_quarter ""
set sel_year ""
switch period {
month { set sel_month selected }
quarter { set sel_quarter selected }
year { set sel_year selected }
}
set admin_html_content "
<form>
<table border=0 cellspacing=1 cellpadding=1>
<tr valign=top><td>
<table border=0 cellspacing=1 cellpadding=1>
<tr>
<td class=form-label>[lang::message::lookup "" intranet-core.Start_Date "Start Date"]</td>
<td class=form-widget>
<input type=textfield name=start_date value=$start_date>
</td>
</tr>
<tr>
<td class=form-label>[lang::message::lookup "" intranet-core.End_Date "End Date"]</td>
<td class=form-widget>
<input type=textfield name=end_date value=$end_date>
</td>
</tr>
<tr>
<td class=form-label>[lang::message::lookup "" intranet-reporting.Period "Period"]</td>
<td class=form-widget>
<select name='period'>
<option $sel_month value='month'>[lang::message::lookup "" acs-datetime.Month "Month"]</option>
<option $sel_quarter value='quarter'>[lang::message::lookup "" intranet-core.Quarter "Quarter"]</option>
<option $sel_year value='year'>[lang::message::lookup "" intranet-core.Year "Year"]</option>
</select>
</td>
</tr>
<tr>
<td class=form-label></td>
<td class=form-widget><input type=submit value='[lang::message::lookup "" acs-kernel.common_Submit "Submit"]'></td>
</tr>
</table>
</tr>
</table>
</form>
"
set left_navbar_html $admin_html_content
<?xml version="1.0"?>
<queryset>
<rdbms><type>postgresql</type><version>7.1</version></rdbms>
<fullquery name="create_response">
<querytext>
select survsimp_response__new (
:response_id,
:survey_id,
null,
'f',
:user_id,
:creation_ip,
:survey_id
)
</querytext>
</fullquery>
<fullquery name="survsimp_question_response_text_insert">
<querytext>
insert into survsimp_question_responses
(response_id, question_id, clob_answer)
values
(:response_id, :question_id, :clob_answer)
</querytext>
</fullquery>
<fullquery name="create_item">
<querytext>
select content_item__new (
varchar :name,
null,
null,
null,
now(),
:user_id,
null,
:creation_ip,
'content_item',
'content_revision',
null,
null,
'text/plain',
null,
null,
'file'
)
</querytext>
</fullquery>
<fullquery name="create_rel">
<querytext>
select acs_rel__new (
null,
'user_blob_response_rel',
:user_id,
:item_id,
null,
null,
null
)
</querytext>
</fullquery>
<fullquery name="create_revision">
<querytext>
declare
v_revision_id integer;
begin
v_revision_id := content_revision__new (
'A Blob Response',
null,
now(),
:guessed_file_type,
null,
'not_important',
:item_id,
null,
now(),
:user_id,
:creation_ip
);
update cr_items
set live_revision = v_revision_id
where item_id = :item_id;
return v_revision_id;
end;
</querytext>
</fullquery>
<fullquery name="update_response">
<querytext>
update cr_revisions
set content = '[cr_create_content_file $item_id $revision_id $tmp_filename]'
where revision_id = :revision_id
</querytext>
</fullquery>
</queryset>
<master>
<property name=title>Response Submitted for @survey_name;noquote@</property>
<property name="context">@context;noquote@</property>
Response submitted for @survey_name@. Thank you.
This diff is collapsed.
<?xml version="1.0"?>
<queryset>
<fullquery name="survey_exists">
<querytext>
select 1 from survsimp_surveys where survey_id = :survey_id
</querytext>
</fullquery>
<fullquery name="survsimp_question_info_list">
<querytext>
select question_id, question_text, abstract_data_type, presentation_type, required_p
from survsimp_questions
where survey_id = :survey_id
and active_p = 't'
order by sort_key
</querytext>
</fullquery>
<fullquery name="survsimp_question_info_list">
<querytext>
select question_id, question_text, abstract_data_type, presentation_type, required_p
from survsimp_questions
where survey_id = :survey_id
and active_p = 't'
order by sort_key
</querytext>
</fullquery>
<fullquery name="survsimp_question_response_checkbox_insert">
<querytext>
insert into survsimp_question_responses (response_id, question_id, choice_id)
values (:response_id, :question_id, :response_value)
</querytext>
</fullquery>
<fullquery name="survsimp_question_response_choice_insert">
<querytext>
insert into survsimp_question_responses (response_id, question_id, choice_id)
values (:response_id, :question_id, :response_value)
</querytext>
</fullquery>
<fullquery name="survsimp_question_choice_shorttext_insert">
<querytext>
insert into survsimp_question_responses (response_id, question_id, varchar_answer)
values (:response_id, :question_id, :response_value)
</querytext>
</fullquery>
<fullquery name="survsimp_question_response_boolean_insert">
<querytext>
insert into survsimp_question_responses (response_id, question_id, boolean_answer)
values (:response_id, :question_id, :response_value)
</querytext>
</fullquery>
<fullquery name="survsimp_question_response_integer_insert">
<querytext>
insert into survsimp_question_responses (response_id, question_id, number_answer)
values (:response_id, :question_id, :response_value)
</querytext>
</fullquery>
<fullquery name="survsimp_question_response_date_insert">
<querytext>
insert into survsimp_question_responses (response_id, question_id, date_answer)
values (:response_id, :question_id, :response_value)
</querytext>
</fullquery>
<fullquery name="get_type">
<querytext>
select type from survsimp_surveys where survey_id = :survey_id
</querytext>
</fullquery>
<fullquery name="survsimp_name_from_id">
<querytext>
select name from survsimp_surveys where survey_id = :survey_id
</querytext>
</fullquery>
<fullquery name="get_score">
<querytext>
select variable_name, sum(score) as sum_of_scores
from survsimp_choice_scores, survsimp_question_responses, survsimp_variables
where survsimp_choice_scores.choice_id = survsimp_question_responses.choice_id
and survsimp_choice_scores.variable_id = survsimp_variables.variable_id
and survsimp_question_responses.response_id = :response_id
group by variable_name
</querytext>
</fullquery>
<fullquery name="get_logic">
<querytext>
select logic from survsimp_logic, survsimp_logic_surveys_map
where survsimp_logic.logic_id = survsimp_logic_surveys_map.logic_id
and survey_id = :survey_id
</querytext>
</fullquery>
<fullquery name="survsimp_question_response_blob_insert">
<querytext>
insert into survsimp_question_responses
(response_id, question_id, item_id,
content_length,
attachment_file_name, attachment_file_type,
attachment_file_extension)
values
(:response_id, :question_id, :item_id,
:content_length,
:response_value, :guessed_file_type,
:file_extension)
</querytext>
</fullquery>
</queryset>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment