CT Survey

BasicProperties lassen sich jetzt editieren.

git-svn-id: https://svn.libreccm.org/ccm/trunk@353 8810af33-2d31-482b-a856-94f89814c4df
master
quasi 2010-02-18 12:56:48 +00:00
parent db3fc80861
commit 67f1083f0c
8 changed files with 199 additions and 614 deletions

View File

@ -1,13 +1,15 @@
model com.arsdigita.cms.contenttypes; model com.arsdigita.cms.contenttypes;
import com.arsdigita.cms.*;
import com.arsdigita.formbuilder.*; import com.arsdigita.formbuilder.*;
import com.arsdigita.kernel.User;
object type Survey extends ContentPage { object type Survey extends ContentPage {
component FormSection[1..1] formSection = join ct_surveys.form_id component FormSection[0..1] formSection = join ct_surveys.form_id
to bebop_form_sections.form_section_id; to bebop_form_sections.form_section_id;
// Date[0..1] startDate = ct_surveys.start_date DATE; // Date[0..1] startDate = ct_surveys.start_date DATE;
// Date[0..1] endDate = ct_surveys.end_date DATE; // Date[0..1] endDate = ct_surveys.end_date DATE;
Boolean[0..1] responsesPublic = ct_surveys.responses_public BOOLEAN; Boolean[0..1] responsesPublic = ct_surveys.responses_public CHAR(1);
reference key ( ct_surveys.survey_id ); reference key ( ct_surveys.survey_id );
} }
@ -19,8 +21,8 @@ object type SurveyResponse extends ContentItem {
to users.user_id; to users.user_id;
Date[1..1] entryDate = ct_surveys_responses.entry_date DATE; Date[1..1] entryDate = ct_surveys_responses.entry_date DATE;
component Answer[1..n] answers = join ct_surveys_responses.response_id component SurveyAnswer[1..n] answers = join ct_surveys_responses.response_id
to ct_surveys_answers.response_id; to ct_surveys_answers.response_id;
// XXX hack to allow us to filter a data query // XXX hack to allow us to filter a data query
BigDecimal[1..1] surveyID = ct_surveys_responses.survey_id INTEGER; BigDecimal[1..1] surveyID = ct_surveys_responses.survey_id INTEGER;
@ -31,448 +33,11 @@ object type SurveyResponse extends ContentItem {
object type SurveyAnswer extends ContentItem{ object type SurveyAnswer extends ContentItem{
BigDecimal[1..1] id = ct_surveys_answers.answer_id INTEGER;
Component[1..1] label = join ct_surveys_answers.label_id Component[1..1] label = join ct_surveys_answers.label_id
to bebop_components.component_id; to bebop_components.component_id;
Component[1..1] widget = join ct_surveys_answers.widget_id Component[1..1] widget = join ct_surveys_answers.widget_id
to bebop_components.component_id; to bebop_components.component_id;
String[0..1] value = ct_surveys_answers.value VARCHAR(4000); String[0..1] value = ct_surveys_answers.value VARCHAR(4000);
object key (id); reference key (ct_surveys_answers.answer_id);
} }
/* From simplesurvey...
query GetAnswersForResponse {
BigDecimal answerID;
String attributeString;
String answerValue;
do {
select ss_answers.answer_id,
ss_answers.response_id,
ss_answers.value,
bebop_components.attribute_string
from ss_answers, bebop_components
where ss_answers.response_id = :responseID
and ss_answers.label_id = bebop_components.component_id
order by ss_answers.response_id, ss_answers.answer_id
} map {
answerID = ss_answers.answer_id;
attributeString = bebop_components.attribute_string;
answerValue = ss_answers.value;
}
}
query GetFormLabels {
BigDecimal labelID;
String attributeString;
do {
select bebop_components.component_id,
bebop_components.attribute_string
from bebop_component_hierarchy, acs_objects, bebop_components, ss_surveys
where bebop_component_hierarchy.container_id = ss_surveys.form_id
and ss_surveys.survey_id = :surveyID
and bebop_component_hierarchy.component_id =
acs_objects.object_id
and acs_objects.default_domain_class = 'com.arsdigita.formbuilder.WidgetLabel'
and bebop_components.component_id = bebop_component_hierarchy.component_id
order by bebop_components.component_id
} map {
labelID = bebop_components.component_id;
attributeString = bebop_components.attribute_string;
}
}
query GetAnswersToQuestion {
BigDecimal answerID;
String answerValue;
do {
select ss_answers.answer_id,
ss_answers.value
from ss_answers, ss_responses
where ss_answers.response_id = ss_responses.response_id
and ss_answers.label_id = :labelID
and ss_responses.entry_date > :startDate
and ss_responses.entry_date < :endDate
} map {
answerID = ss_answers.answer_id;
answerValue = ss_answers.value;
}
}
query getCorrectAnswerToQuestion {
// This returns one correct answer value corresponding to the question's label
String answerValue;
do {
select value from ss_correct_answers
where label_id = :labelID
} map {
answerValue = value;
}
}
query getCorrectAnswers {
// This returns all labels to one survey
String answerValue;
BigInteger widgetID;
String parameterName;
String parameterModel;
String domainClass;
do {
select sca.value,
bc.component_id as widget_id,
bw.parameter_name,
bw.parameter_model,
o.default_domain_class
from bebop_component_hierarchy bch,
bebop_components bc,
bebop_widgets bw,
ss_surveys s,
ss_correct_answers sca,
acs_objects o
where bch.container_id = s.form_id
and sca.widget_id = bch.component_id
and bc.component_id = bch.component_id
and bc.component_id = bw.widget_id
and bc.component_id = o.object_id
and s.survey_id = :surveyID
} map {
widgetID = widget_id;
answerValue = sca.value;
parameterName = bw.parameter_name;
parameterModel = bw.parameter_model;
domainClass = o.default_domain_class;
}
}
query correctAnswerExists {
Boolean answerExists;
do {
select 1 as answer_exists_p from ss_correct_answers
where label_id = :labelID and widget_id = :widgetID
} map {
answerExists = answer_exists_p;
}
}
data operation insertCorrectAnswer {
do {
insert into ss_correct_answers( label_id, widget_id, value )
values ( :labelID, :widgetID, :value )
}
}
data operation updateCorrectAnswer {
do {
update ss_correct_answers set value = :value
where label_id = :labelID and widget_id = :widgetID
}
}
data operation updateAnswerValue {
do {
update bebop_options set answer_value = :answerValue
where option_id = :optionID
}
}
query GetAllAnswers {
BigDecimal responseID;
BigDecimal labelID;
String answerValue;
do {
select ss_answers.value,
ss_answers.response_id,
ss_answers.label_id
from ss_answers
where ss_answers.response_id in (select response_id from ss_responses
where survey_id = :surveyID)
order by ss_answers.response_id, ss_answers.label_id
} map {
answerValue = ss_answers.value;
responseID = ss_answers.response_id;
labelID = ss_answers.label_id;
}
}
query GetWidgetClassAfterLabel {
String widgetClass;
do {
select acs_objects.default_domain_class
from bebop_component_hierarchy, acs_objects
where bebop_component_hierarchy.component_id = acs_objects.object_id
and bebop_component_hierarchy.container_id = (select container_id from bebop_component_hierarchy
where component_id = :labelID)
and bebop_component_hierarchy.order_number = (select order_number + 1 from
bebop_component_hierarchy where component_id = :labelID)
} map {
widgetClass = acs_objects.default_domain_class;
}
}
query GetOneAnswerQuestionStatistics {
String value;
BigDecimal numberOfAnswers;
do {
select count(ss_answers.answer_id) number_of_answers,
ss_answers.value
from ss_answers
where ss_answers.label_id = :labelID
group by ss_answers.value
} map {
value = ss_answers.value;
numberOfAnswers = number_of_answers;
}
}
query getAnswerOption {
String questionText;
String answerText;
BigDecimal answerValue;
BigDecimal optionID;
do {
select h2.component_id as option_id,
op.label as answer_text,
op.answer_value,
bc.attribute_string as question_text
from bebop_component_hierarchy h1,
bebop_component_hierarchy h2,
bebop_component_hierarchy h3,
bebop_components bc,
bebop_options op,
acs_objects o2
where h2.container_id = h1.component_id
and h2.component_id = op.option_id
and bc.component_id = h3.component_id
and o2.object_id = h3.component_id
and h3.order_number = h1.order_number - 1
and h3.container_id = h1.container_id
and h2.component_id = op.option_id
and op.option_id = :optionID
and o2.default_domain_class = 'com.arsdigita.formbuilder.WidgetLabel'
} map {
optionID = option_id;
answerValue = answer_value;
questionText = question_text;
answerText = answer_text;
}
}
query getSurveyStatistics {
BigDecimal score;
BigDecimal surveyNumber;
BigDecimal surveyPercentage;
do {
select score,
survey_number,
round((survey_number/total)*100) as survey_percentage
from ( select r1.score,
count(*) survey_number,
r2.total
from ss_responses r1,
(select count(*) as total from ss_responses r3
where r3.survey_id = :surveyID) r2
where r1.survey_id = :surveyID
group by r1.score, r2.total) s
} map {
surveyNumber = survey_number;
score = score;
surveyPercentage = survey_percentage;
}
}
query GetTotalNumberOfAnswers {
BigDecimal numberOfAnswers;
do {
select count(*) number_of_answers
from ss_answers where label_id = :labelID
} map {
numberOfAnswers = number_of_answers;
}
}
query getAnswerOptions {
// Returns all singleselect/select multiple questions with one row per possible answer
// for the selected survey. Yes, we are assuming that the label is always directly before the widget on the form.
String questionText;
String answerText;
BigDecimal optionID;
BigDecimal labelID;
BigDecimal widgetID;
BigDecimal answerValue;
do {
select h1.component_id as widget_id,
h2.component_id as option_id,
bc.attribute_string as label_text,
bc.component_id as label_id,
op.label as option_text,
op.answer_value
from bebop_component_hierarchy h1,
bebop_component_hierarchy h2,
bebop_component_hierarchy h3,
bebop_options op,
bebop_components bc,
ss_surveys s,
acs_objects o2
where h2.container_id = h1.component_id
and h1.container_id = s.form_id
and bc.component_id = h3.component_id
and o2.object_id = h3.component_id
and h2.component_id = op.option_id
and h3.order_number = h1.order_number - 1
and h3.container_id = h1.container_id
and o2.default_domain_class = 'com.arsdigita.formbuilder.WidgetLabel' and s.survey_id = :surveyID
order by widget_id
} map {
widgetID = widget_id;
optionID = option_id;
questionText = label_text;
answerText = option_text;
labelID = label_id;
answerValue = answer_value;
}
}
data operation saveScore {
// Saves the score of the completed survey (only relevant for knowledge test surveys)
do {
update ss_responses set score =(
select count(*) from
ss_answers a,
ss_correct_answers ca
where a.widget_id = ca.widget_id
and a.value = ca.value
and a.response_id = :responseID
) where response_id = :responseID
}
}
data operation saveAssessmentScore {
// Saves the score of the completed survey (only relevant for personal assessment surveys)
do {
update ss_responses set score =
(select s.sum_points/t.total
from (select count(*) as total from ss_answers where response_id=:responseID) t,
(select sum(a.value) as sum_points
from bebop_options bo,
ss_surveys s,
ss_answers a,
bebop_component_hierarchy h1,
bebop_component_hierarchy h2
where s.form_id = h1.container_id
and h2.container_id = h1.component_id
and h2.component_id = bo.option_id
and bo.label = a.value
and a.response_id = :responseID) s)
where response_id = :responseID
}
}
query getResponseResults{
// Returns the user's answer vs the correct answer for a survey response of a knowledge test survey
BigDecimal questionNumber;
BigDecimal answerID;
String userAnswer;
String correctAnswer;
do {
select rownum as question_number,
a.answer_id,
a.value as user_answer,
ca.value as correct_answer
from ss_answers a,
ss_correct_answers ca
where a.widget_id(+) = ca.widget_id
and a.response_id = :responseID
order by a.widget_id
} map {
questionNumber = question_number;
answerID = a.answer_id;
userAnswer = a.user_answer;
correctAnswer = ca.correct_answer;
}
}
query getAssessmentResults {
// Returns the score of a user based on a personal assessment kind of survey (i.e. average answer option value)
BigDecimal answerCount; // The number of answers for which the user received this point value
BigDecimal answerValue; // THe point value for this answer
do { select count(*) as answer_count,
bo.answer_value
from bebop_options bo,
ss_surveys s,
ss_answers a,
bebop_component_hierarchy h1,
bebop_component_hierarchy h2
where s.form_id = h1.container_id
and h2.container_id = h1.component_id
and h2.component_id = bo.option_id
and bo.label = a.value
and a.response_id = :responseID
group by bo.answer_value
} map {
answerCount = answer_count;
answerValue = answer_value;
}
}
query getUserScore {
// Returns the user's score given a responseID for a knowledge test kind of survey
BigDecimal userScore;
BigDecimal maxScore;
do { select max(r.score) as user_score,
count(value) as max_score
from ss_responses r,
ss_correct_answers sca,
bebop_component_hierarchy bch,
bebop_components bc,
bebop_widgets bw,
ss_surveys s
where bch.container_id = s.form_id
and sca.widget_id = bch.component_id
and bc.component_id = bch.component_id
and bc.component_id = bw.widget_id
and s.survey_id = r.survey_id
and r.response_id = :responseID
} map {
userScore = user_score;
maxScore = max_score;
}
}
query questionsAnswered {
Boolean questionsAnswered;
do {
select decode(count(*),0,0,1) as questions_answered_p
from ss_answers a
where a.response_id = :responseID
} map {
questionsAnswered = questions_answered_p;
}
}
query getAllUsersScore {
// Returns the number of users that achieved each score for this
// particular survey
BigDecimal userCount;
BigDecimal surveyScore;
do { select count(response_id) as user_count, r.score
from ss_responses r
where r.survey_id = :surveyID
group by score
} map {
userCount = user_count;
surveyScore = r.score;
}
}
*/

View File

@ -18,7 +18,7 @@
labelBundle="com.arsdigita.cms.ui.CMSResources" labelBundle="com.arsdigita.cms.ui.CMSResources"
descriptionKey="cms.contenttypes.shared.basic_properties.description" descriptionKey="cms.contenttypes.shared.basic_properties.description"
descriptionBundle="com.arsdigita.cms.ui.CMSResources" descriptionBundle="com.arsdigita.cms.ui.CMSResources"
component="com.arsdigita.cms.contenttypes.ui.BaseContactPropertiesStep" component="com.arsdigita.cms.contenttypes.ui.SurveyPropertiesStep"
ordering="1"/> ordering="1"/>
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/> <ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>

View File

@ -31,7 +31,7 @@ public class Survey extends ContentPage {
/** PDL property name for responsesPublic */ /** PDL property name for responsesPublic */
public static final String RESPONSES_PUBLIC = "responsesPublic"; public static final String RESPONSES_PUBLIC = "responsesPublic";
/** Data object type for this domain object */ /** Data object type for this domain object */
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.simplesurvey.Survey"; public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Survey";
/** /**
* Default constructor. This creates a new (empty) Survey. * Default constructor. This creates a new (empty) Survey.
@ -124,8 +124,8 @@ public class Survey extends ContentPage {
return (Date)get(END_DATE); return (Date)get(END_DATE);
} }
*/ */
public boolean getResponsesPublic() { public Boolean getResponsesPublic() {
return ((Boolean) get(RESPONSES_PUBLIC)); return (Boolean) get(RESPONSES_PUBLIC);
} }
public void setResponsesPublic(Boolean responsesPublic) { public void setResponsesPublic(Boolean responsesPublic) {

View File

@ -1,58 +1,58 @@
cms.contenttypes.ui.survey.ui.admin.and=and cms.contenttypes.ui.survey.and=and
cms.contenttypes.ui.survey.ui.admin.add_new_survey=Add new Survey cms.contenttypes.ui.survey.add_new_survey=Add new Survey
cms.contenttypes.ui.survey.ui.admin.add_new_poll=Add new Poll cms.contenttypes.ui.survey.add_new_poll=Add new Poll
cms.contenttypes.ui.survey.ui.admin.surveys=Surveys cms.contenttypes.ui.survey.surveys=Surveys
cms.contenttypes.ui.survey.ui.admin.polls=Polls cms.contenttypes.ui.survey.polls=Polls
cms.contenttypes.ui.survey.ui.admin.back_to_question_list=Back to question list cms.contenttypes.ui.survey.back_to_question_list=Back to question list
cms.contenttypes.ui.survey.ui.admin.question=Question: cms.contenttypes.ui.survey.question=Question:
cms.contenttypes.ui.survey.ui.admin.back_to_response_list=Back to response list cms.contenttypes.ui.survey.back_to_response_list=Back to response list
cms.contenttypes.ui.survey.ui.admin.name=Name: cms.contenttypes.ui.survey.name=Name:
cms.contenttypes.ui.survey.ui.admin.description=Description: cms.contenttypes.ui.survey.description=Description:
cms.contenttypes.ui.survey.ui.admin.start_date=Start Date: cms.contenttypes.ui.survey.start_date=Start Date:
cms.contenttypes.ui.survey.ui.admin.end_date=End Date: cms.contenttypes.ui.survey.end_date=End Date:
cms.contenttypes.ui.survey.ui.admin.back_to_survey_list=Back to survey list cms.contenttypes.ui.survey.back_to_survey_list=Back to survey list
cms.contenttypes.ui.survey.ui.admin.questions_of_the_survey=Questions of the Survey cms.contenttypes.ui.survey.questions_of_the_survey=Questions of the Survey
cms.contenttypes.ui.survey.ui.admin.responses_to_the_survey=Responses to the Survey cms.contenttypes.ui.survey.responses_to_the_survey=Responses to the Survey
cms.contenttypes.ui.survey.ui.admin.export_response_data=Export Response Data cms.contenttypes.ui.survey.export_response_data=Export Response Data
cms.contenttypes.ui.survey.ui.admin.administration=Administration cms.contenttypes.ui.survey.administration=Administration
cms.contenttypes.ui.survey.ui.admin.active=active cms.contenttypes.ui.survey.active=active
cms.contenttypes.ui.survey.ui.admin.inactive=inactive cms.contenttypes.ui.survey.inactive=inactive
cms.contenttypes.ui.survey.ui.admin.view_responses=View Responses cms.contenttypes.ui.survey.view_responses=View Responses
cms.contenttypes.ui.survey.ui.admin.edit_controls=Edit controls cms.contenttypes.ui.survey.edit_controls=Edit controls
cms.contenttypes.ui.survey.ui.admin.edit_properties=Edit properties cms.contenttypes.ui.survey.edit_properties=Edit properties
cms.contenttypes.ui.survey.ui.admin.delete=Delete cms.contenttypes.ui.survey.delete=Delete
cms.contenttypes.ui.survey.ui.admin.should_quiz_responses_be_public=Should responses be public? cms.contenttypes.ui.survey.should_quiz_responses_be_public=Should responses be public?
cms.contenttypes.ui.survey.ui.admin.set_correct_answers=Set correct answers cms.contenttypes.ui.survey.set_correct_answers=Set correct answers
cms.contenttypes.ui.survey.ui.admin.what_type_of_quiz_is_this= What type of quiz is this? cms.contenttypes.ui.survey.what_type_of_quiz_is_this= What type of quiz is this?
cms.contenttypes.ui.survey.ui.admin.knowledge_test_quiz=Knowledge Test cms.contenttypes.ui.survey.knowledge_test_quiz=Knowledge Test
cms.contenttypes.ui.survey.ui.admin.personal_assessment_quiz=Personal Assessment cms.contenttypes.ui.survey.personal_assessment_quiz=Personal Assessment
cms.contenttypes.ui.survey.ui.admin.question=Question cms.contenttypes.ui.survey.question=Question
cms.contenttypes.ui.survey.ui.admin.answer=Answer cms.contenttypes.ui.survey.answer=Answer
cms.contenttypes.ui.survey.ui.admin.edit_value=Edit Value cms.contenttypes.ui.survey.edit_value=Edit Value
cms.contenttypes.ui.survey.ui.admin.current_value=Current Value cms.contenttypes.ui.survey.current_value=Current Value
cms.contenttypes.ui.survey.ui.admin.submit=Submit cms.contenttypes.ui.survey.submit=Submit
cms.contenttypes.ui.survey.ui.admin.done_editing=Done Editing cms.contenttypes.ui.survey.done_editing=Done Editing
cms.contenttypes.ui.survey.ui.admin.set_answer_values=Set answer values cms.contenttypes.ui.survey.set_answer_values=Set answer values
cms.contenttypes.ui.survey.ui.Yes=Yes cms.contenttypes.ui.survey.Yes=Yes
cms.contenttypes.ui.survey.ui.No=No cms.contenttypes.ui.survey.No=No
cms.contenttypes.ui.survey.ui.you_have_scored_out_of_a_possible=You have scored {0} out of a possible {1} point(s). cms.contenttypes.ui.survey.you_have_scored_out_of_a_possible=You have scored {0} out of a possible {1} point(s).
cms.contenttypes.ui.survey.ui.you_have_scored=You have scored cms.contenttypes.ui.survey.you_have_scored=You have scored
cms.contenttypes.ui.survey.ui.answers_worth=answer(s) worth cms.contenttypes.ui.survey.answers_worth=answer(s) worth
cms.contenttypes.ui.survey.ui.view_all_results= View public statistics cms.contenttypes.ui.survey.view_all_results= View public statistics
cms.contenttypes.ui.survey.ui.points=points cms.contenttypes.ui.survey.points=points
cms.contenttypes.ui.survey.ui.administer=Administer cms.contenttypes.ui.survey.administer=Administer
cms.contenttypes.ui.survey.ui.active_surveys=Active Surveys cms.contenttypes.ui.survey.active_surveys=Active Surveys
cms.contenttypes.ui.survey.ui.active_polls=Active Polls cms.contenttypes.ui.survey.active_polls=Active Polls
cms.contenttypes.ui.survey.ui.simple_survey_index_page=Simple Survey Index Page cms.contenttypes.ui.survey.simple_survey_index_page=Simple Survey Index Page
cms.contenttypes.ui.survey.ui.this_survey_is_not_currently_active=This survey is not currently active cms.contenttypes.ui.survey.this_survey_is_not_currently_active=This survey is not currently active
cms.contenttypes.ui.survey.ui.you_have_already_completed_this_survey=You have already completed this survey cms.contenttypes.ui.survey.you_have_already_completed_this_survey=You have already completed this survey
cms.contenttypes.ui.survey.ui.thankyou_for_completing_the_survey=Thank you for completing this survey! cms.contenttypes.ui.survey.thankyou_for_completing_the_survey=Thank you for completing this survey!
cms.contenttypes.ui.survey.ui.question_number=Question Number cms.contenttypes.ui.survey.question_number=Question Number
cms.contenttypes.ui.survey.ui.user_answer=User Answer cms.contenttypes.ui.survey.user_answer=User Answer
cms.contenttypes.ui.survey.ui.correct_answer=Correct Answer cms.contenttypes.ui.survey.correct_answer=Correct Answer
cms.contenttypes.ui.survey.ui.score=Score cms.contenttypes.ui.survey.score=Score
cms.contenttypes.ui.survey.ui.number_of_surveys=Number of Surveys cms.contenttypes.ui.survey.number_of_surveys=Number of Surveys
cms.contenttypes.ui.survey.ui.percentage=Surveys in percent cms.contenttypes.ui.survey.percentage=Surveys in percent

View File

@ -1,59 +1,59 @@
cms.contenttypes.ui.survey.ui.admin.and=und cms.contenttypes.ui.survey.and=und
cms.contenttypes.ui.survey.ui.admin.add_new_survey=Neue Umfrage hinzuf\u00FCgen cms.contenttypes.ui.survey.add_new_survey=Neue Umfrage hinzuf\u00FCgen
cms.contenttypes.ui.survey.ui.admin.surveys=Umfragens cms.contenttypes.ui.survey.surveys=Umfragens
cms.contenttypes.ui.survey.ui.admin.back_to_question_list=Zur\u00FCck zur Fragenliste cms.contenttypes.ui.survey.back_to_question_list=Zur\u00FCck zur Fragenliste
cms.contenttypes.ui.survey.ui.admin.question=Frage: cms.contenttypes.ui.survey.question=Frage:
cms.contenttypes.ui.survey.ui.admin.back_to_response_list=Zur\u00FCck zur Antwortliste cms.contenttypes.ui.survey.back_to_response_list=Zur\u00FCck zur Antwortliste
cms.contenttypes.ui.survey.ui.admin.name=Name: cms.contenttypes.ui.survey.name=Name:
cms.contenttypes.ui.survey.ui.admin.description=Beschreibung: cms.contenttypes.ui.survey.description=Beschreibung:
cms.contenttypes.ui.survey.ui.admin.start_date=Startdatum: cms.contenttypes.ui.survey.start_date=Startdatum:
cms.contenttypes.ui.survey.ui.admin.end_date=Enddatum: cms.contenttypes.ui.survey.end_date=Enddatum:
cms.contenttypes.ui.survey.ui.admin.back_to_survey_list=Zur\u00FCck zur Umfrageliste cms.contenttypes.ui.survey.back_to_survey_list=Zur\u00FCck zur Umfrageliste
cms.contenttypes.ui.survey.ui.admin.questions_of_the_survey=Fragen der Umfrage cms.contenttypes.ui.survey.questions_of_the_survey=Fragen der Umfrage
cms.contenttypes.ui.survey.ui.admin.responses_to_the_survey=Antworten der Umfrage cms.contenttypes.ui.survey.responses_to_the_survey=Antworten der Umfrage
cms.contenttypes.ui.survey.ui.admin.export_response_data=Antworten exportieren cms.contenttypes.ui.survey.export_response_data=Antworten exportieren
cms.contenttypes.ui.survey.ui.admin.administration=Administration cms.contenttypes.ui.survey.administration=Administration
cms.contenttypes.ui.survey.ui.admin.active=aktiv cms.contenttypes.ui.survey.active=aktiv
cms.contenttypes.ui.survey.ui.admin.inactive=inaktiv cms.contenttypes.ui.survey.inactive=inaktiv
cms.contenttypes.ui.survey.ui.admin.view_responses=Antworten ansehen cms.contenttypes.ui.survey.view_responses=Antworten ansehen
cms.contenttypes.ui.survey.ui.admin.edit_controls=Edit controls cms.contenttypes.ui.survey.edit_controls=Edit controls
cms.contenttypes.ui.survey.ui.admin.edit_properties=Eigenschaften bearbeiten cms.contenttypes.ui.survey.edit_properties=Eigenschaften bearbeiten
cms.contenttypes.ui.survey.ui.admin.delete=L\u00F6schen cms.contenttypes.ui.survey.delete=L\u00F6schen
cms.contenttypes.ui.survey.ui.admin.should_quiz_responses_be_public=Sollen die Antworten \u00F6ffentlich sein? cms.contenttypes.ui.survey.should_quiz_responses_be_public=Sollen die Antworten \u00F6ffentlich sein?
cms.contenttypes.ui.survey.ui.admin.question=Frage cms.contenttypes.ui.survey.question=Frage
cms.contenttypes.ui.survey.ui.admin.answer=Antwort cms.contenttypes.ui.survey.answer=Antwort
cms.contenttypes.ui.survey.ui.admin.edit_value=Wert bearbeiten cms.contenttypes.ui.survey.edit_value=Wert bearbeiten
cms.contenttypes.ui.survey.ui.admin.current_value=Aktueller Wert cms.contenttypes.ui.survey.current_value=Aktueller Wert
cms.contenttypes.ui.survey.ui.admin.submit=Absenden cms.contenttypes.ui.survey.submit=Absenden
cms.contenttypes.ui.survey.ui.admin.done_editing=Bearbeitung beenden cms.contenttypes.ui.survey.done_editing=Bearbeitung beenden
cms.contenttypes.ui.survey.ui.admin.set_answer_values=Antwortwert setzen cms.contenttypes.ui.survey.set_answer_values=Antwortwert setzen
cms.contenttypes.ui.survey.ui.admin.set_correct_answers=Set correct answers cms.contenttypes.ui.survey.set_correct_answers=Set correct answers
cms.contenttypes.ui.survey.ui.admin.what_type_of_quiz_is_this= What type of quiz is this? cms.contenttypes.ui.survey.what_type_of_quiz_is_this= What type of quiz is this?
cms.contenttypes.ui.survey.ui.admin.knowledge_test_quiz=Knowledge Test cms.contenttypes.ui.survey.knowledge_test_quiz=Knowledge Test
cms.contenttypes.ui.survey.ui.admin.personal_assessment_quiz=Personal Assessment cms.contenttypes.ui.survey.personal_assessment_quiz=Personal Assessment
cms.contenttypes.ui.survey.ui.you_have_scored_out_of_a_possible=You have scored {0} out of a possible {1} point(s). cms.contenttypes.ui.survey.you_have_scored_out_of_a_possible=You have scored {0} out of a possible {1} point(s).
cms.contenttypes.ui.survey.ui.you_have_scored=You have scored cms.contenttypes.ui.survey.you_have_scored=You have scored
cms.contenttypes.ui.survey.ui.answers_worth=answer(s) worth cms.contenttypes.ui.survey.answers_worth=answer(s) worth
cms.contenttypes.ui.survey.ui.Yes=Ja cms.contenttypes.ui.survey.Yes=Ja
cms.contenttypes.ui.survey.ui.No=Nein cms.contenttypes.ui.survey.No=Nein
cms.contenttypes.ui.survey.ui.view_all_results= View public statistics cms.contenttypes.ui.survey.view_all_results= View public statistics
cms.contenttypes.ui.survey.ui.points=points cms.contenttypes.ui.survey.points=points
cms.contenttypes.ui.survey.ui.administer=Administer cms.contenttypes.ui.survey.administer=Administer
cms.contenttypes.ui.survey.ui.active_surveys=Active Surveys cms.contenttypes.ui.survey.active_surveys=Active Surveys
cms.contenttypes.ui.survey.ui.active_polls=Active Polls cms.contenttypes.ui.survey.active_polls=Active Polls
cms.contenttypes.ui.survey.ui.simple_survey_index_page=Simple Survey Index Page cms.contenttypes.ui.survey.simple_survey_index_page=Simple Survey Index Page
cms.contenttypes.ui.survey.ui.this_survey_is_not_currently_active=This survey is not currently active cms.contenttypes.ui.survey.this_survey_is_not_currently_active=This survey is not currently active
cms.contenttypes.ui.survey.ui.you_have_already_completed_this_survey=You have already completed this survey cms.contenttypes.ui.survey.you_have_already_completed_this_survey=You have already completed this survey
cms.contenttypes.ui.survey.ui.thankyou_for_completing_the_survey=Thank you for completing this survey! cms.contenttypes.ui.survey.thankyou_for_completing_the_survey=Thank you for completing this survey!
cms.contenttypes.ui.survey.ui.question_number=Question Number cms.contenttypes.ui.survey.question_number=Question Number
cms.contenttypes.ui.survey.ui.user_answer=User Answer cms.contenttypes.ui.survey.user_answer=User Answer
cms.contenttypes.ui.survey.ui.correct_answer=Correct Answer cms.contenttypes.ui.survey.correct_answer=Correct Answer
cms.contenttypes.ui.survey.ui.score=Score cms.contenttypes.ui.survey.score=Score
cms.contenttypes.ui.survey.ui.number_of_surveys=Number of Surveys cms.contenttypes.ui.survey.number_of_surveys=Number of Surveys
cms.contenttypes.ui.survey.ui.percentage=Surveys in percent cms.contenttypes.ui.survey.percentage=Surveys in percent

View File

@ -1,60 +1,60 @@
cms.contenttypes.ui.survey.ui.admin.and=et cms.contenttypes.ui.survey.and=et
cms.contenttypes.ui.survey.ui.admin.add_new_survey=Ajouter un nouveau sondage cms.contenttypes.ui.survey.add_new_survey=Ajouter un nouveau sondage
cms.contenttypes.ui.survey.ui.admin.add_new_poll=Ajouter un nouveau scrutin cms.contenttypes.ui.survey.add_new_poll=Ajouter un nouveau scrutin
cms.contenttypes.ui.survey.ui.admin.surveys=Sondages cms.contenttypes.ui.survey.surveys=Sondages
cms.contenttypes.ui.survey.ui.admin.polls=Scrutins cms.contenttypes.ui.survey.polls=Scrutins
cms.contenttypes.ui.survey.ui.admin.back_to_question_list=Retour \u00E0 la liste des questions cms.contenttypes.ui.survey.back_to_question_list=Retour \u00E0 la liste des questions
cms.contenttypes.ui.survey.ui.admin.question=Question: cms.contenttypes.ui.survey.question=Question:
cms.contenttypes.ui.survey.ui.admin.back_to_response_list=Retour \u00E0 la liste des r\u00E9ponses cms.contenttypes.ui.survey.back_to_response_list=Retour \u00E0 la liste des r\u00E9ponses
cms.contenttypes.ui.survey.ui.admin.name=Titre: cms.contenttypes.ui.survey.name=Titre:
cms.contenttypes.ui.survey.ui.admin.description=Description: cms.contenttypes.ui.survey.description=Description:
cms.contenttypes.ui.survey.ui.admin.start_date=Date de d\u00E9marrage: cms.contenttypes.ui.survey.start_date=Date de d\u00E9marrage:
cms.contenttypes.ui.survey.ui.admin.end_date=Date de fin: cms.contenttypes.ui.survey.end_date=Date de fin:
cms.contenttypes.ui.survey.ui.admin.back_to_survey_list=Retour \u00E0 la liste des sondages cms.contenttypes.ui.survey.back_to_survey_list=Retour \u00E0 la liste des sondages
cms.contenttypes.ui.survey.ui.admin.questions_of_the_survey=Questions de l'enqu\u00EAte cms.contenttypes.ui.survey.questions_of_the_survey=Questions de l'enqu\u00EAte
cms.contenttypes.ui.survey.ui.admin.responses_to_the_survey=Responses de l'enqu\u00EAte cms.contenttypes.ui.survey.responses_to_the_survey=Responses de l'enqu\u00EAte
cms.contenttypes.ui.survey.ui.admin.export_response_data=Exporter les r\u00E9ponses cms.contenttypes.ui.survey.export_response_data=Exporter les r\u00E9ponses
cms.contenttypes.ui.survey.ui.admin.administration=Administration cms.contenttypes.ui.survey.administration=Administration
cms.contenttypes.ui.survey.ui.admin.active=actif cms.contenttypes.ui.survey.active=actif
cms.contenttypes.ui.survey.ui.admin.inactive=inactif cms.contenttypes.ui.survey.inactive=inactif
cms.contenttypes.ui.survey.ui.admin.view_responses=Voir les r\u00E9ponses cms.contenttypes.ui.survey.view_responses=Voir les r\u00E9ponses
cms.contenttypes.ui.survey.ui.admin.edit_controls=Modifier les contr\u00F4les cms.contenttypes.ui.survey.edit_controls=Modifier les contr\u00F4les
cms.contenttypes.ui.survey.ui.admin.edit_properties=Modifier les propri\u00E9t\u00E9s cms.contenttypes.ui.survey.edit_properties=Modifier les propri\u00E9t\u00E9s
cms.contenttypes.ui.survey.ui.admin.delete=Effacer cms.contenttypes.ui.survey.delete=Effacer
cms.contenttypes.ui.survey.ui.admin.should_quiz_responses_be_public=Est-e que les r\u00E9ponses sont public? cms.contenttypes.ui.survey.should_quiz_responses_be_public=Est-e que les r\u00E9ponses sont public?
cms.contenttypes.ui.survey.ui.admin.set_correct_answers=Indiquer les bonnes r\u00E9ponses. cms.contenttypes.ui.survey.set_correct_answers=Indiquer les bonnes r\u00E9ponses.
cms.contenttypes.ui.survey.ui.admin.what_type_of_quiz_is_this=Quel est le type de ce quiz? cms.contenttypes.ui.survey.what_type_of_quiz_is_this=Quel est le type de ce quiz?
cms.contenttypes.ui.survey.ui.admin.knowledge_test_quiz=Tests de connaissances cms.contenttypes.ui.survey.knowledge_test_quiz=Tests de connaissances
cms.contenttypes.ui.survey.ui.admin.personal_assessment_quiz=Evaluation personnelle cms.contenttypes.ui.survey.personal_assessment_quiz=Evaluation personnelle
cms.contenttypes.ui.survey.ui.admin.question=Question cms.contenttypes.ui.survey.question=Question
cms.contenttypes.ui.survey.ui.admin.answer=R\u00E9ponse cms.contenttypes.ui.survey.answer=R\u00E9ponse
cms.contenttypes.ui.survey.ui.admin.edit_value=Modifier la valeur cms.contenttypes.ui.survey.edit_value=Modifier la valeur
cms.contenttypes.ui.survey.ui.admin.current_value=Valeur courante cms.contenttypes.ui.survey.current_value=Valeur courante
cms.contenttypes.ui.survey.ui.admin.submit=Soumettre cms.contenttypes.ui.survey.submit=Soumettre
cms.contenttypes.ui.survey.ui.admin.done_editing=Modifications effectu\u00E9es cms.contenttypes.ui.survey.done_editing=Modifications effectu\u00E9es
cms.contenttypes.ui.survey.ui.admin.set_answer_values=Indiquer la valeur des r\u00E9ponses cms.contenttypes.ui.survey.set_answer_values=Indiquer la valeur des r\u00E9ponses
cms.contenttypes.ui.survey.ui.Yes=oui cms.contenttypes.ui.survey.Yes=oui
cms.contenttypes.ui.survey.ui.No=Non cms.contenttypes.ui.survey.No=Non
cms.contenttypes.ui.survey.ui.you_have_scored_out_of_a_possible=Vous avez marqu\u00E9 {0} point(s) sur un total de {1}. cms.contenttypes.ui.survey.you_have_scored_out_of_a_possible=Vous avez marqu\u00E9 {0} point(s) sur un total de {1}.
cms.contenttypes.ui.survey.ui.you_have_scored=Vous avez marqu\u00E9 cms.contenttypes.ui.survey.you_have_scored=Vous avez marqu\u00E9
cms.contenttypes.ui.survey.ui.answers_worth=answer(s) worth cms.contenttypes.ui.survey.answers_worth=answer(s) worth
cms.contenttypes.ui.survey.ui.view_all_results=Voir les statistiques publique cms.contenttypes.ui.survey.view_all_results=Voir les statistiques publique
cms.contenttypes.ui.survey.ui.points=points cms.contenttypes.ui.survey.points=points
cms.contenttypes.ui.survey.ui.administer=Administrer cms.contenttypes.ui.survey.administer=Administrer
cms.contenttypes.ui.survey.ui.active_surveys=Enqu\u00EAtes actives cms.contenttypes.ui.survey.active_surveys=Enqu\u00EAtes actives
cms.contenttypes.ui.survey.ui.active_polls=Scrutins actifs cms.contenttypes.ui.survey.active_polls=Scrutins actifs
cms.contenttypes.ui.survey.ui.simple_survey_index_page=Sommaire des enqu\u00EAtes actives cms.contenttypes.ui.survey.simple_survey_index_page=Sommaire des enqu\u00EAtes actives
cms.contenttypes.ui.survey.ui.this_survey_is_not_currently_active=Cette enqu\u00EAte n'est active actuellement cms.contenttypes.ui.survey.this_survey_is_not_currently_active=Cette enqu\u00EAte n'est active actuellement
cms.contenttypes.ui.survey.ui.you_have_already_completed_this_survey=Vous avez d\u00E9j\u00E0 r\u00E9pondu \u00E0 cette enqu\u00EAte cms.contenttypes.ui.survey.you_have_already_completed_this_survey=Vous avez d\u00E9j\u00E0 r\u00E9pondu \u00E0 cette enqu\u00EAte
cms.contenttypes.ui.survey.ui.thankyou_for_completing_the_survey=Merci d'avoir r\u00E9pondu \u00E0 cette enqu\u00EAte cms.contenttypes.ui.survey.thankyou_for_completing_the_survey=Merci d'avoir r\u00E9pondu \u00E0 cette enqu\u00EAte
cms.contenttypes.ui.survey.ui.question_number=Question Num\u00E9ro cms.contenttypes.ui.survey.question_number=Question Num\u00E9ro
cms.contenttypes.ui.survey.ui.user_answer=R\u00E9ponse de l'utilisateur cms.contenttypes.ui.survey.user_answer=R\u00E9ponse de l'utilisateur
cms.contenttypes.ui.survey.ui.correct_answer=Bonne r\u00E9ponse cms.contenttypes.ui.survey.correct_answer=Bonne r\u00E9ponse
cms.contenttypes.ui.survey.ui.score=Score cms.contenttypes.ui.survey.score=Score
cms.contenttypes.ui.survey.ui.number_of_surveys=Nombre d'enqu\u00EAtes cms.contenttypes.ui.survey.number_of_surveys=Nombre d'enqu\u00EAtes
cms.contenttypes.ui.survey.ui.percentage=Pourcentages sur les enqu\u00EAtes cms.contenttypes.ui.survey.percentage=Pourcentages sur les enqu\u00EAtes
cms.contenttypes.ui.survey.ui.you_have_already_completed_this_survey=TRANSLATE THIS: You have already completed this survey (cms.contenttypes.ui.survey.ui.you_have_already_completed_this_survey) cms.contenttypes.ui.survey.you_have_already_completed_this_survey=TRANSLATE THIS: You have already completed this survey (cms.contenttypes.ui.survey.you_have_already_completed_this_survey)

View File

@ -94,6 +94,7 @@ public class SurveyPropertiesForm extends BasicPageForm implements FormProcessLi
add(new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.survey.ui.admin.should_quiz_responses_be_public").localize())); add(new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.survey.ui.admin.should_quiz_responses_be_public").localize()));
RadioGroup responsesPublic = new RadioGroup("responsesPublic"); RadioGroup responsesPublic = new RadioGroup("responsesPublic");
// NotNullValidationListener
Option rp1 = new Option("true", new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.survey.ui.Yes").localize())); Option rp1 = new Option("true", new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.survey.ui.Yes").localize()));
Option rp2 = new Option("false", new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.survey.ui.No").localize())); Option rp2 = new Option("false", new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.survey.ui.No").localize()));
responsesPublic.addOption(rp1); responsesPublic.addOption(rp1);
@ -110,7 +111,9 @@ public class SurveyPropertiesForm extends BasicPageForm implements FormProcessLi
data.put(DESCRIPTION, survey.getDescription()); data.put(DESCRIPTION, survey.getDescription());
// data.put(START_DATE, survey.getStartDate()); // data.put(START_DATE, survey.getStartDate());
// data.put(END_DATE, survey.getEndDate()); // data.put(END_DATE, survey.getEndDate());
data.put(RESPONSES_PUBLIC, survey.getResponsesPublic()); if(survey.getResponsesPublic() != null) {
data.put(RESPONSES_PUBLIC, survey.getResponsesPublic().booleanValue());
}
} }
@Override @Override
@ -123,7 +126,7 @@ public class SurveyPropertiesForm extends BasicPageForm implements FormProcessLi
survey.setDescription((String) data.get(DESCRIPTION)); survey.setDescription((String) data.get(DESCRIPTION));
// survey.setStartDate((String)data.get(START_DATE)); // survey.setStartDate((String)data.get(START_DATE));
// survey.setEndDate((String)data.get(END_DATE)); // survey.setEndDate((String)data.get(END_DATE));
survey.setResponsesPublic((Boolean) data.get(RESPONSES_PUBLIC)); survey.setResponsesPublic(new Boolean((String)data.get(RESPONSES_PUBLIC)));
survey.save(); survey.save();
} }

View File

@ -14,6 +14,7 @@ import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Component;
import com.arsdigita.bebop.Label; import com.arsdigita.bebop.Label;
import com.arsdigita.bebop.SegmentedPanel; import com.arsdigita.bebop.SegmentedPanel;
import com.arsdigita.cms.contenttypes.Survey;
import com.arsdigita.cms.contenttypes.util.SurveyGlobalizationUtil; import com.arsdigita.cms.contenttypes.util.SurveyGlobalizationUtil;
import java.text.DateFormat; import java.text.DateFormat;
@ -56,7 +57,7 @@ public class SurveyPropertiesStep extends SimpleEditStep {
basicProperties.add(EDIT_BASIC_SHEET_NAME, (String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.edit_basic_properties").localize(), new WorkflowLockedComponentAccess(editBasicSheet, itemModel), editBasicSheet.getSaveCancelSection().getCancelButton()); basicProperties.add(EDIT_BASIC_SHEET_NAME, (String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.edit_basic_properties").localize(), new WorkflowLockedComponentAccess(editBasicSheet, itemModel), editBasicSheet.getSaveCancelSection().getCancelButton());
/* Set the displayComponent for this step */ /* Set the displayComponent for this step */
basicProperties.setDisplayComponent(getSurveyPropertiesSheet(itemModel)); basicProperties.setDisplayComponent(SurveyPropertiesStep.getSurveyPropertiesSheet(itemModel));
/* Add the SimpleEditStep to the segmented panel */ /* Add the SimpleEditStep to the segmented panel */
segmentedPanel.addSegment(new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.basic_properties").localize()), basicProperties); segmentedPanel.addSegment(new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.basic_properties").localize()), basicProperties);
@ -84,6 +85,22 @@ public class SurveyPropertiesStep extends SimpleEditStep {
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"), "name"); sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"), "name");
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), "title"); sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), "title");
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.description"), ContentPage.DESCRIPTION);
sheet.add(SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.should_quiz_responses_be_public"), Survey.RESPONSES_PUBLIC, new DomainObjectPropertySheet.AttributeFormatter() {
public String format(DomainObject obj, String attribute, PageState state) {
Survey survey = (Survey) obj;
if (survey.getResponsesPublic() != null) {
if(survey.getResponsesPublic().booleanValue() == true) {
return (String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.Yes").localize();
} else{
return (String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.No").localize();
}
} else {
return (String) GlobalizationUtil.globalize("cms.ui.unknown").localize();
}
}
});
if (!ContentSection.getConfig().getHideLaunchDate()) { if (!ContentSection.getConfig().getHideLaunchDate()) {
sheet.add(GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date"), ContentPage.LAUNCH_DATE, new DomainObjectPropertySheet.AttributeFormatter() { sheet.add(GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date"), ContentPage.LAUNCH_DATE, new DomainObjectPropertySheet.AttributeFormatter() {