[open-ils-commits] [GIT] Evergreen ILS branch master updated. 98deff54108cd1b07b66679d2e0872c88969e26c

Evergreen Git git at git.evergreen-ils.org
Thu Nov 9 09:26:51 EST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  98deff54108cd1b07b66679d2e0872c88969e26c (commit)
       via  3937b2389ee75a365f2167699a9650a951add829 (commit)
      from  dd825128fadea4be0f59ee3ffba22aafbf6804b8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 98deff54108cd1b07b66679d2e0872c88969e26c
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Thu Nov 9 09:46:35 2017 -0500

    LP#1728677: add release notes entry
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/docs/RELEASE_NOTES_NEXT/Architecture/Sample_Data_Includes_Surveys.adoc b/docs/RELEASE_NOTES_NEXT/Architecture/Sample_Data_Includes_Surveys.adoc
new file mode 100644
index 0000000..caa2fe6
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Architecture/Sample_Data_Includes_Surveys.adoc
@@ -0,0 +1,4 @@
+Sample Data Includes Surveys
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+The Concerto sample data set now includes patron surveys, questions,
+answers, and responses.

commit 3937b2389ee75a365f2167699a9650a951add829
Author: Chris Sharp <csharp at georgialibraries.org>
Date:   Mon Oct 30 12:29:20 2017 -0400

    LP#1728677 - Add survey data to concerto test dataset.
    
    To more closely approximate a realistic test environment,
    this branch adds data to the concerto test dataset.  Most users
    are given a randomized response to a simple 3-question survey.
    
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/tests/datasets/sql/load_all.sql b/Open-ILS/tests/datasets/sql/load_all.sql
index df4e532..ce89563 100644
--- a/Open-ILS/tests/datasets/sql/load_all.sql
+++ b/Open-ILS/tests/datasets/sql/load_all.sql
@@ -87,6 +87,9 @@ INSERT INTO biblio.record_entry (marc, last_xact_id)
 -- load MR copies, etc.
 \i assets_mr.sql
 
+-- load survey data
+\i surveys.sql
+
 -- clean up the env
 \i env_destroy.sql
 
diff --git a/Open-ILS/tests/datasets/sql/surveys.sql b/Open-ILS/tests/datasets/sql/surveys.sql
new file mode 100644
index 0000000..f45de8d
--- /dev/null
+++ b/Open-ILS/tests/datasets/sql/surveys.sql
@@ -0,0 +1,52 @@
+/** Create a survey */
+INSERT INTO action.survey (id, owner, name, description) VALUES (1, 1, 'Who would cross the Bridge of Death must answer me these questions three, ere the other side he see.', 'Test survey for concerto dataset');
+
+/** Populate with questions */
+INSERT INTO action.survey_question (id, survey, question) VALUES (1, 1, 'What... is your name?');
+INSERT INTO action.survey_question (id, survey, question) VALUES (2, 1, 'What... is your quest?');
+INSERT INTO action.survey_question (id, survey, question) VALUES (3, 1, 'What... is your favorite color?');
+
+/** Attach answers to questions */
+INSERT INTO action.survey_answer (id, question, answer) VALUES (1, 1, 'My name is Sir Lancelot of Camelot.');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (2, 1, 'Sir Robin of Camelot.');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (3, 1, 'Sir Galahad of Camelot.');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (4, 1, 'General Leia Organa.');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (5, 1, 'Dr. Beverly Crusher.');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (6, 1, 'Rose Tyler.');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (7, 1, 'Sorry, not interested.');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (8, 2, 'To seek the Holy Grail.');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (9, 2, 'To go where no one has gone before.');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (10, 2, 'To steal the plans for the Death Star.');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (11, 2, 'To save the universe from the Daleks again.');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (12, 2, 'What is this again?');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (13, 3, 'Blue');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (14, 3, 'Blue. No yellow... AAAGGH!');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (15, 3, 'Jedi cloak brown.');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (16, 3, 'Redshirt red.');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (17, 3, 'TARDIS blue.');
+INSERT INTO action.survey_answer (id, question, answer) VALUES (18, 3, 'This is getting too silly - I quit.');
+
+/** for every user with an id not evenly divisible by 6, 
+ *  add a randomized response for every question in the survey
+ */
+CREATE FUNCTION populate_survey_responses(usr INTEGER) RETURNS VOID AS
+$BODY$
+DECLARE q INT;
+BEGIN
+IF usr % 6 <> 0 THEN
+    FOR q in 1..3 LOOP
+        INSERT INTO action.survey_response (usr, survey, question, answer, answer_date) VALUES (
+        usr,
+        1,
+        q,
+        (SELECT id FROM action.survey_answer WHERE question = q ORDER BY random() LIMIT 1),
+        now());
+    END LOOP;
+END IF;
+END;
+$BODY$
+LANGUAGE plpgsql;
+
+SELECT populate_survey_responses(id) FROM actor.usr;
+
+DROP FUNCTION populate_survey_responses(usr INTEGER);

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/tests/datasets/sql/load_all.sql           |    3 +
 Open-ILS/tests/datasets/sql/surveys.sql            |   52 ++++++++++++++++++++
 .../Architecture/Sample_Data_Includes_Surveys.adoc |    4 ++
 3 files changed, 59 insertions(+), 0 deletions(-)
 create mode 100644 Open-ILS/tests/datasets/sql/surveys.sql
 create mode 100644 docs/RELEASE_NOTES_NEXT/Architecture/Sample_Data_Includes_Surveys.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list