Difference between revisions of "Template:SetTopicCurrentAnswer"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
 
Line 2: Line 2:
 
This template is called from topic templates to save records of which communities have currently accepted answers to the question and the respective accepted answers. This includes:
 
This template is called from topic templates to save records of which communities have currently accepted answers to the question and the respective accepted answers. This includes:
  
* Complete answers: all the direct answers to the question;
+
* Direct answers: all the direct answers to the question (complete or partial);
* Inherited: all the answers to the superquestions (complete or inherited);
+
* Superanswers: all the answers to the superquestions (complete or partial);
* Partial: all the answers to the qubquestions (complete or partial); this option is used only if there are no complete answers to the question.
+
* Subanswers: all the answers to the subquestions (complete or partial).
  
 
For each community where the topic is currently accepted, the template searches for accepted theories, and if a theory is found, for each theory it creates a combined subobject with the following properties:
 
For each community where the topic is currently accepted, the template searches for accepted theories, and if a theory is found, for each theory it creates a combined subobject with the following properties:
Line 14: Line 14:
 
* <code><nowiki>Community</nowiki></code> - the community that accepts the theory.
 
* <code><nowiki>Community</nowiki></code> - the community that accepts the theory.
 
* <code><nowiki>Theory</nowiki></code> - the full page name of the theories that answer the topic.
 
* <code><nowiki>Theory</nowiki></code> - the full page name of the theories that answer the topic.
* <code><nowiki>Answer Type</nowiki></code> - Complete for direct answers, Partial for answers to subquestions, and Inherited for answers to superquestions.
+
* <code><nowiki>Directness</nowiki></code> - Possible values are {Direct, Superanswer, Subanswer, None}. ''None'' is used for empty answers.
* <code><nowiki>Original Topic</nowiki></code> - the original topic to which the theories were the answer to. For inherited answers, this will hold the fullpagename of the parent topic (superquestion). For partial answers gauged from the subquestions, this will hold the fullpagename of the child topic (subquestion). For direct answers, this will be equal to Topic.  
+
* <code><nowiki>Completeness</nowiki></code> - Possible values are {Complete, Partial, None}. ''None'' is used for empty answers.
 +
* <code><nowiki>Original Topic</nowiki></code> - the original topic to which the theories is a ''direct'' answer to. For ''superanswers'' answers, this will hold the fullpagename of the parent topic (superquestion). Note that this won't be the grandparent topic even if the answer was a direct answer to a grandfather question. For ''subanswers'', this will hold the fullpagename of the child topic (subquestion). For direct answers, this will be equal to Topic.  
 
* <code><nowiki>Sorting Order</nowiki></code> - the Sorting Order of the topic; this is used to sort the accepted answers when displaying them.
 
* <code><nowiki>Sorting Order</nowiki></code> - the Sorting Order of the topic; this is used to sort the accepted answers when displaying them.
* <code><nowiki>Formulation Text</nowiki></code> - this is the combined formulation text of the answers to the original topic. If the original topic has a multiple answer formula, then the multiple answers will be combined here. Suppose the question ''Epistemic Stances Towards Theories'' has several accepted answers, such as:
+
* <code><nowiki>Formulation Text</nowiki></code> - this is the combined formulation text of the answers to the original topic. If the original topic has a multiple answer formula, then the multiple answers will be combined here.  
 +
 
 +
Suppose the question ''Epistemic Stances Towards Theories'' has several accepted answers, such as:
 
* The stance of theory acceptance can be taken towards theories.  
 
* The stance of theory acceptance can be taken towards theories.  
 
* The stance of theory pursuit can be taken towards theories.
 
* The stance of theory pursuit can be taken towards theories.
Line 25: Line 28:
 
* The stances of theory acceptance, theory pursuit, and theory use can be taken towards theories.
 
* The stances of theory acceptance, theory pursuit, and theory use can be taken towards theories.
  
If the original topic has no multiple answer formula, all the answers will be added one after another; since each formulation text is a full sentence, a space will be added as a separator.
+
If the original topic has no multiple answer formula, all the answers will be added one after another in one record; since each formulation text is a full sentence, a space will be added as a separator.
  
If no theory is found that answers the question, its superquestions or its subquestions, an empty subobject is created:
+
If no theory is found that answers the question, its superquestions or its subquestions, an empty subobject is created with:
* <code><nowiki>Answer Type</nowiki></code> = None.
+
* <code><nowiki>Completeness</nowiki></code> = None.
 +
* <code><nowiki>Directness</nowiki></code> = None.
  
 +
The following algorithm is used to decide which superanswers and subanswers to count and create subobjects for:
 +
 +
[[File:Counting Superanswers Subanswers Activity Diagram 2024.png|850px]]
 +
 +
There are three main scenarios, visualized in the following diagram:
 +
 +
[[File:Counting Superanswers Subanswers Chart 2024.png|1000px]]
  
 
'''NOTE:''' As any "set" template, it doesn't print anything on the page, but merely sets the appropriate values.
 
'''NOTE:''' As any "set" template, it doesn't print anything on the page, but merely sets the appropriate values.
Line 42: Line 53:
 
-->{{#if: {{{topic|}}}<!--
 
-->{{#if: {{{topic|}}}<!--
 
  -->|<!--  
 
  -->|<!--  
   --><!-- get topic info
+
   --><!-- get the topic info
   -->{{#vardefine: varTopicType|{{#show: {{{topic|}}}|?Topic Type|link=none}}|}}<!--
+
   -->{{#vardefine: varTopicType|{{#show: {{{topic|}}}|?Topic Type|link=none}}|}}<!--   
 +
  -->{{#vardefine: varSortingOrder|{{#show: {{{topic|}}}|?Sorting Order|link=none}}|}}<!--
 
   -->{{#arraydefine: arrayParentTopics|{{#show: {{{topic|}}}|?Parent Topic|link=none}}|,|}}<!--  
 
   -->{{#arraydefine: arrayParentTopics|{{#show: {{{topic|}}}|?Parent Topic|link=none}}|,|}}<!--  
 
   -->{{#arrayunique: arrayParentTopics}}<!-- remove duplicates and empty values
 
   -->{{#arrayunique: arrayParentTopics}}<!-- remove duplicates and empty values
Line 49: Line 61:
 
   -->{{#arraydefine: varCommunities|{{PrintTopicCurrentlyAcceptedInCommunitiesList|topic={{{topic|}}}|link=none}}|,|}}<!--  
 
   -->{{#arraydefine: varCommunities|{{PrintTopicCurrentlyAcceptedInCommunitiesList|topic={{{topic|}}}|link=none}}|,|}}<!--  
 
   -->{{#arrayunique: varCommunities}}<!-- remove duplicates and empty values
 
   -->{{#arrayunique: varCommunities}}<!-- remove duplicates and empty values
 +
 +
  --><!--
 +
  --><!-- Repeat the following cycle for each community where the topic is accepted
 +
  --><!--
 
   -->{{#arrayprint: varCommunities||varCommunity|<!--
 
   -->{{#arrayprint: varCommunities||varCommunity|<!--
  
 +
  --><!--
 +
  --><!-- STEP 0: Reset the Has Answer flag and Completeness on each cycle
 
   --><!--  
 
   --><!--  
 
   -->{{#vardefine: varHasAnswer|no}}<!--  
 
   -->{{#vardefine: varHasAnswer|no}}<!--  
 +
  -->{{#vardefine: varCompleteness|None}}<!--
 
   --><!--  
 
   --><!--  
  
 
   --><!--  
 
   --><!--  
   --><!-- The complete answers to parent questions must be added as answers to the question regardless of whether the question has any direct answers
+
   --><!-- STEP 1: Search for direct answers to the question accepted by the community and see if any of them are complete answers
 
   --><!--  
 
   --><!--  
   -->{{#arrayprint: arrayParentTopics||varParentTopic|<!--
+
   -->{{#arraydefine: varTheories|{{PrintTopicAnswerAcceptedInCommunity|topic={{{topic|}}}|community=varCommunity|link=none}}|,|}}<!--
    --><!--
+
  -->{{#arrayunique: varTheories}}<!-- remove duplicates and empty values
    --><!-- Check if the parent topic has accepted theories: these can be complete or inherited: copy as inherited answers to the topic 
+
  --><!--  
    --><!--
+
 
    -->{{#ask:<!--
+
  --><!--
    -->[[SubObjectCategory::Current Answer]]<!--
+
  --><!-- STEP 2: Store all the direct answers, if any
    -->[[Community::varCommunity]]<!--
+
  --><!--
    -->[[Topic::varParentTopic]]<!--
+
  -->{{#ifeq: {{#arraysize: varTheories}}|0||<!-- check if there are currently accepted direct answers
    -->[[Answer Type::Complete||Inherited]]<!--
+
 
    -->|?Topic<!--
+
     --><!--
    -->|?Original Topic<!--
+
    --><!-- 2.1. the topic has direct answers: set the flag
    -->|?Community<!--
+
     --><!--
    -->|?Subfield<!--
+
    -->{{#vardefine: varHasAnswer|yes}}<!--  
    -->|?Topic Type<!--
+
 
    -->|?Theory<!--
+
    --><!--
    -->|?Formulation Text<!--
+
    --><!-- 2.2. get the Formulation Text: this function combines the formulation texts of individual theories if necessary
    -->|?Sorting Order<!--
+
    --><!--
    -->|headers=hide<!--
+
    -->{{#vardefine: varFormulationText|{{GetTopicCurrentAnswerFormulationText|topic={{{topic|}}}|community=varCommunity}}|}}<!--
    -->|mainlabel=-<!--
+
    --><!--
    -->|link=none<!--
 
    -->|limit=10000<!--
 
    -->|named args=yes<!--
 
    -->|format=template<!--
 
    -->|template=SetTopicCurrentAnswer-inherited<!--
 
    -->|userparam={{{topic|}}}<!--
 
    -->}}<!--
 
 
 
    --><!--
 
    -->{{#arraydefine: varParentTheories<!--
 
    -->|{{#ask:<!--
 
      -->[[SubObjectCategory::Current Answer]]<!--
 
      -->[[Community::varCommunity]]<!--
 
      -->[[Topic::varParentTopic]]<!--
 
      -->[[Answer Type::Complete||Inherited]]<!--
 
      -->|?Theory<!--
 
      -->|headers=hide<!--
 
      -->|mainlabel=-<!--
 
      -->|link=none<!--
 
      -->|limit=10000<!--
 
      -->}}<!--
 
    -->| , |unique<!--
 
    -->}}<!-- array define
 
    --><!--
 
    -->{{#arrayunique: varParentTheories}}<!-- remove duplicates
 
    --><!--
 
    --><!-- check if there are any results
 
    -->{{#ifeq: {{#arraysize: varParentTheories}}|0<!--
 
     -->|<!--
 
      --><!-- no answers found: nothing todo
 
     -->|<!--
 
      --><!-- the topic has answers
 
      -->{{#vardefine: varHasAnswer|yes}}<!--  
 
      --><!--
 
      --><!-- set all the theories as accepted by the community
 
      -->{{#arrayprint: varParentTheories||varTheory<!--
 
      -->|<!--
 
        -->{{#set: Has Accepted Answer In {{PAGENAME:varCommunity}}=varTheory}}<!--
 
        --><!--
 
      -->}}<!-- arrayprint varParentTheories
 
      --><!--
 
    -->}}<!-- ifeq
 
  
     --><!--
+
    --><!--
    --><!--  
+
    --><!-- 2.3 get the Completeness; if at least one of the accepted answers is a complete answer, then this should say Complete;
  -->}}<!-- arrayprint arrayParentTopics
+
    --><!--     otherwise it should say Partial
  --><!--  
+
    --><!--
 +
    -->{{#vardefine: varCompleteness|Partial}}<!--
 +
    --><!-- 
 +
    -->{{#arrayprint: varTheories||varTheory|<!--
 +
      --><!--
 +
      -->{{#ifeq: {{#show: varTheory|?Completeness|link=none}}|Complete|<!--
 +
        --><!--
 +
        -->{{#vardefine: varCompleteness|Complete}}<!--
 +
        --><!--
 +
      -->}}<!-- ifeq
 +
    -->}}<!-- arrayprint varTheories
 +
    --><!--
  
  --><!--  
+
    --><!--
  --><!-- Now search for direct answers to the question
+
    --><!-- 2.4. store one combined Current Answer subobject for all direct answers; this simplifies the retrieval of the current answer info
  --><!--  
+
    --><!--
  -->{{#arraydefine: varTheories|{{PrintTopicAnswerAcceptedInCommunity|topic={{{topic|}}}|community=varCommunity|link=none}}|,|}}<!--
+
    -->{{#subobject:<!--
  -->{{#arrayunique: varTheories}}<!-- remove duplicates and empty values
+
      -->|SubObjectCategory=Current Answer<!--
  -->{{#switch: {{#arraysize: varTheories}}<!-- check if the array exists
+
      -->|Topic={{{topic|}}}<!--
 +
      -->|Original Topic={{{topic|}}}<!--
 +
      -->|Parent Topic={{#arrayprint: arrayParentTopics|,}}|+sep=,<!--
 +
      -->|Subfield={{{subfield|Dynamics}}}<!--
 +
      -->|Topic Type={{#var: varTopicType}}<!--
 +
      -->|Community=varCommunity<!--
 +
      -->|Formulation Text={{#var: varFormulationText}}<!--  
 +
      -->|Theory={{#arrayprint: varTheories|,}}|+sep=,<!--
 +
      -->|Directness=Direct<!--  
 +
      -->|Completeness={{#var: varCompleteness}}<!--
 +
      -->|Sorting Order={{#var: varSortingOrder}}<!--
 +
    -->}}<!-- subobject
 +
    --><!--
 
   
 
   
    -->|0=<!--
 
 
     --><!--
 
     --><!--
     --><!-- No direct answers are found
+
     --><!-- 2.5. set all the theories as accepted by the community
 +
    --><!--      These silly looking records come in handy when quickly retrieving whether the theory is accepted in a given community
 
     --><!--
 
     --><!--
     --><!-- Check if any of the subtopics have complete or partial accepted answers and copy them as partial answers to the topic
+
     -->{{#arrayprint: varTheories||varTheory<!--
 +
      -->|<!--
 +
      --><!--
 +
      -->{{#set: Has Accepted Answer In {{PAGENAME:varCommunity}}=varTheory}}<!--
 +
      --><!--
 +
    -->}}<!-- arrayprint varTheories
 +
 
 +
  -->}}<!-- ifeq - if there are currently accepted direct answers
 +
 
 +
 
 +
  --><!--
 +
  --><!-- STEP 3: If there are no direct answers then add all the subanswers
 +
  --><!--
 +
  -->{{#ifeq: {{#arraysize: varTheories}}|0|<!--
 +
    --><!--
 +
    --><!-- 3.1. Check if the subtopics have direct answers or subanswers of their own and copy them as partial answers to the topic
 +
    --><!--      The template SetTopicCurrentAnswer-subanswer does the actual creation of the subobjects
 
     --><!--
 
     --><!--
 
     -->{{#ask:<!--
 
     -->{{#ask:<!--
Line 142: Line 158:
 
       -->[[Community::varCommunity]]<!--  
 
       -->[[Community::varCommunity]]<!--  
 
       -->[[Parent Topic::{{{topic|}}}]]<!--  
 
       -->[[Parent Topic::{{{topic|}}}]]<!--  
       -->[[Answer Type::Complete||Partial]]<!--  
+
       -->[[Directness::Direct||Subanswer]]<!--  
 
       -->|?Topic<!--  
 
       -->|?Topic<!--  
 
       -->|?Original Topic<!--  
 
       -->|?Original Topic<!--  
Line 157: Line 173:
 
       -->|named args=yes<!--
 
       -->|named args=yes<!--
 
       -->|format=template<!--
 
       -->|format=template<!--
       -->|template=SetTopicCurrentAnswer-partial<!--
+
       -->|template=SetTopicCurrentAnswer-subanswer<!--  
 
       -->|userparam={{{topic|}}}<!--
 
       -->|userparam={{{topic|}}}<!--
 
     -->}}<!--
 
     -->}}<!--
 
     --><!--
 
     --><!--
 +
 +
    --><!--
 +
    --><!-- 3.2. Now get the array of these answers; this is required so that we know if there are any.
 +
    --><!--      The previous operation doesn't tell us if there are any.
 
     --><!--
 
     --><!--
 
     -->{{#arraydefine: varSubtopicsTheories<!--
 
     -->{{#arraydefine: varSubtopicsTheories<!--
Line 167: Line 187:
 
         -->[[Community::varCommunity]]<!--  
 
         -->[[Community::varCommunity]]<!--  
 
         -->[[Parent Topic::{{{topic|}}}]]<!--  
 
         -->[[Parent Topic::{{{topic|}}}]]<!--  
         -->[[Answer Type::Complete||Partial]]<!--  
+
         -->[[Directness::Direct||Subanswer]]<!--  
 
         -->|?Theory<!--  
 
         -->|?Theory<!--  
 
         -->|headers=hide<!--
 
         -->|headers=hide<!--
Line 180: Line 200:
 
     --><!--
 
     --><!--
 
      
 
      
    --><!-- Check if there are any theories in the array
 
 
     --><!--
 
     --><!--
     -->{{#switch: {{#arraysize: varSubtopicsTheories}}<!--
+
     --><!-- 3.3. Check if there are any theories in the array
 
+
    --><!--
      -->|0=<!--
+
    -->{{#ifeq: {{#arraysize: varSubtopicsTheories}}|0||<!--
      --><!-- Subtopics too don't have an accepted answer
 
      --><!--
 
  
      --><!-- store an empty record 
 
      --><!--
 
      -->{{#subobject:<!--
 
        -->|SubObjectCategory=Current Answer<!--
 
        -->|Topic={{{topic|}}}<!--
 
        -->|Original Topic=<!--
 
        -->|Parent Topic={{#arrayprint: arrayParentTopics|,}}|+sep=,<!--
 
        -->|Subfield={{{subfield|Dynamics}}}<!--
 
        -->|Topic Type={{#var: varTopicType}}<!--
 
        -->|Community=varCommunity<!--
 
        -->|Theory=<!--
 
        -->|Formulation Text=<!--
 
        -->|Answer Type=None<!--
 
        -->|Sorting Order=0<!--
 
      -->}}<!-- subobject
 
 
       --><!--
 
       --><!--
 
+
       --><!-- Subtopics have accepted answers: set the Has Answer flag
      -->|<!--
 
       --><!-- Subtopics have accepted answers  
 
 
       -->{{#vardefine: varHasAnswer|yes}}<!--  
 
       -->{{#vardefine: varHasAnswer|yes}}<!--  
 
       --><!--
 
       --><!--
Line 221: Line 221:
 
       --><!--
 
       --><!--
  
     -->}}<!-- switch arraysize varSubtopicsTheories
+
     -->}}<!-- ifeq arraysize varSubtopicsTheories
 
     --><!--
 
     --><!--
  
 +
  -->}}<!-- ifeq - if there are no direct answers
 +
 +
 +
  --><!--
 +
  --><!-- STEP 4: If there are no direct answers, or if none of the direct answers is a complete answer, then store the superanswers
 +
  --><!--
 +
  -->{{#ifeq: {{#var: varCompleteness}}|None|<!--
 +
 +
    --><!--
 +
    -->{{#arrayprint: arrayParentTopics||varParentTopic|<!--
 +
 +
      --><!--
 +
      --><!-- 4.1. Check if the parent topic has accepted theories: these can be direct answers or superanswers.
 +
      --><!--      Copy these as superanswers to the question: template SetTopicCurrentAnswer-superanswer does the honors
 +
      --><!--
 +
      -->{{#ask:<!--
 +
      -->[[SubObjectCategory::Current Answer]]<!--
 +
      -->[[Community::varCommunity]]<!--
 +
      -->[[Topic::varParentTopic]]<!--
 +
      -->[[Directness::Direct||Superanswer]]<!--
 +
      -->|?Topic<!--
 +
      -->|?Original Topic<!--
 +
      -->|?Community<!--
 +
      -->|?Subfield<!--
 +
      -->|?Topic Type<!--
 +
      -->|?Theory<!--
 +
      -->|?Formulation Text<!--
 +
      -->|?Completeness<!--
 +
      -->|?Sorting Order<!--
 +
      -->|headers=hide<!--
 +
      -->|mainlabel=-<!--
 +
      -->|link=none<!--
 +
      -->|limit=10000<!--
 +
      -->|named args=yes<!--
 +
      -->|format=template<!--
 +
      -->|template=SetTopicCurrentAnswer-superanswer<!--
 +
      -->|userparam={{{topic|}}}<!--
 +
      -->}}<!--
 +
 
 +
      --><!--
 +
      --><!-- 4.2. Now get the array of superanswers. These are needed to know if there were any superanswers.
 +
      --><!--      The previous operation doesn't get this info.
 +
      --><!--
 +
      -->{{#arraydefine: varParentTheories<!--
 +
      -->|{{#ask:<!--
 +
        -->[[SubObjectCategory::Current Answer]]<!--
 +
        -->[[Community::varCommunity]]<!--
 +
        -->[[Topic::varParentTopic]]<!--
 +
        -->[[Directness::Direct||Superanswer]]<!--
 +
        -->|?Theory<!--
 +
        -->|headers=hide<!--
 +
        -->|mainlabel=-<!--
 +
        -->|link=none<!--
 +
        -->|limit=10000<!--
 +
        -->}}<!--
 +
      -->| , |unique<!--
 +
      -->}}<!-- array define
 +
      --><!--
 +
      -->{{#arrayunique: varParentTheories}}<!-- remove duplicates
 +
     
 +
      --><!--
 +
      --><!-- check if there are any superanswers
 +
      --><!--
 +
      -->{{#ifeq: {{#arraysize: varParentTheories}}|0||<!--
 +
     
 +
        --><!--
 +
        --><!-- There are superanswers: set the Has Answer flag
 +
        --><!--
 +
        -->{{#vardefine: varHasAnswer|yes}}<!--
 +
        --><!--
 +
        --><!-- set all the theories as accepted by the community for ease of access
 +
        --><!--
 +
        -->{{#arrayprint: varParentTheories||varTheory<!--
 +
        -->|<!--
 +
          -->{{#set: Has Accepted Answer In {{PAGENAME:varCommunity}}=varTheory}}<!--
 +
          --><!--
 +
        -->}}<!-- arrayprint varParentTheories
 +
        --><!--
 +
 +
      -->}}<!-- ifeq - if there are superanswers
 +
 +
    -->}}<!-- arrayprint arrayParentTopics
 +
 +
  -->}}<!-- ifeq - if there are no complete answers
 
   
 
   
   -->|<!--
+
 
    --><!-- the topic has direct answers
+
  --><!--
 +
   --><!-- STEP 5: If no answers were found, add an empty record.
 +
  --><!--         Such records are handy when building tables with all the current topics and their answers; 
 +
  --><!--        these show that a topic doesn't have an answer with an empty cell.
 +
  --><!--
 +
  -->{{#ifeq: {{#var: varHasAnswer}}|no<!--
 +
 
 +
    -->|<!--
 +
 
 
     --><!--
 
     --><!--
 
+
    --><!-- Store the Has No Accepted Answer record for the ease of use
 
     --><!--
 
     --><!--
     -->{{#vardefine: varHasAnswer|no}}<!--  
+
     -->{{#set: Has No Accepted Answer=varCommunity}}<!--
  
 
     --><!--
 
     --><!--
     --><!-- get the sorting order
+
     --><!-- Store an empty record 
    -->{{#vardefine: varSortingOrder|{{#show: {{{topic|}}}|?Sorting Order|link=none}}|}}<!--
 
    --><!--
 
    --><!-- get the formulation text: this function combines the formulation texts of individual theories if necessary
 
    -->{{#vardefine: varFormulationText|{{GetTopicCurrentAnswerFormulationText|topic={{{topic|}}}|community=varCommunity}}|}}<!--
 
 
     --><!--
 
     --><!--
    --><!-- store a subobject for the answers
 
 
     -->{{#subobject:<!--  
 
     -->{{#subobject:<!--  
 
       -->|SubObjectCategory=Current Answer<!--  
 
       -->|SubObjectCategory=Current Answer<!--  
 
       -->|Topic={{{topic|}}}<!--  
 
       -->|Topic={{{topic|}}}<!--  
       -->|Original Topic={{{topic|}}}<!--  
+
       -->|Original Topic=<!--  
 
       -->|Parent Topic={{#arrayprint: arrayParentTopics|,}}|+sep=,<!--  
 
       -->|Parent Topic={{#arrayprint: arrayParentTopics|,}}|+sep=,<!--  
 
       -->|Subfield={{{subfield|Dynamics}}}<!--  
 
       -->|Subfield={{{subfield|Dynamics}}}<!--  
 
       -->|Topic Type={{#var: varTopicType}}<!--  
 
       -->|Topic Type={{#var: varTopicType}}<!--  
 
       -->|Community=varCommunity<!--  
 
       -->|Community=varCommunity<!--  
       -->|Formulation Text={{#var: varFormulationText}}<!--  
+
      -->|Theory=<!--
       -->|Theory={{#arrayprint: varTheories|,}}|+sep=,<!--  
+
       -->|Formulation Text=<!--  
       -->|Answer Type=Complete<!--  
+
       -->|Completeness=None<!--  
 +
       -->|Directness=None<!--  
 
       -->|Sorting Order={{#var: varSortingOrder}}<!--  
 
       -->|Sorting Order={{#var: varSortingOrder}}<!--  
 
     -->}}<!-- subobject
 
     -->}}<!-- subobject
 
     --><!--
 
     --><!--
 
    --><!-- set all the theories as accepted by the community
 
    -->{{#arrayprint: varTheories||varTheory<!--
 
      -->|<!--
 
      --><!--
 
      -->{{#set: Has Accepted Answer In {{PAGENAME:varCommunity}}=varTheory}}<!--
 
      --><!--
 
    -->}}<!-- arryprint varTheories
 
   
 
  -->}}<!-- switch arraysize varTheories
 
  
  --><!--
 
  --><!-- set Has Accepted Answer or Has No Accepted Answer
 
  --><!--
 
  -->{{#ifeq: {{#var: varHasAnswer}}|yes<!--
 
 
     -->|<!--  
 
     -->|<!--  
 +
 +
    --><!--
 +
    --><!-- Store the Has Accepted Answer record for the ease of use
 +
    --><!--
 
     -->{{#set: Has Accepted Answer=varCommunity}}<!--  
 
     -->{{#set: Has Accepted Answer=varCommunity}}<!--  
 
     --><!--
 
     --><!--
    -->|<!--
+
 
    -->{{#set: Has No Accepted Answer=varCommunity}}<!--
+
   -->}}<!-- ifeq - if there are no answers
    --><!--
 
   -->}}<!-- ifeq  
 
  
  
 
   -->}}<!-- array print varCommunities
 
   -->}}<!-- array print varCommunities
  --><!--
+
 
  
 
-->}}<!-- if topic
 
-->}}<!-- if topic
 
--></includeonly>
 
--></includeonly>

Latest revision as of 11:08, 22 June 2024

This template is called from topic templates to save records of which communities have currently accepted answers to the question and the respective accepted answers. This includes:

  • Direct answers: all the direct answers to the question (complete or partial);
  • Superanswers: all the answers to the superquestions (complete or partial);
  • Subanswers: all the answers to the subquestions (complete or partial).

For each community where the topic is currently accepted, the template searches for accepted theories, and if a theory is found, for each theory it creates a combined subobject with the following properties:

  • SubObjectCategory = "Current Answer".
  • Topic - the question the theory is trying to answer.
  • Topic Type - the type of the topic for ease of access (Normative, Descriptive, Definitional)
  • Parent Topic - the topic's parent topic for ease of access. //What happens when there are multiple parent topics?
  • Community - the community that accepts the theory.
  • Theory - the full page name of the theories that answer the topic.
  • Directness - Possible values are {Direct, Superanswer, Subanswer, None}. None is used for empty answers.
  • Completeness - Possible values are {Complete, Partial, None}. None is used for empty answers.
  • Original Topic - the original topic to which the theories is a direct answer to. For superanswers answers, this will hold the fullpagename of the parent topic (superquestion). Note that this won't be the grandparent topic even if the answer was a direct answer to a grandfather question. For subanswers, this will hold the fullpagename of the child topic (subquestion). For direct answers, this will be equal to Topic.
  • Sorting Order - the Sorting Order of the topic; this is used to sort the accepted answers when displaying them.
  • Formulation Text - this is the combined formulation text of the answers to the original topic. If the original topic has a multiple answer formula, then the multiple answers will be combined here.

Suppose the question Epistemic Stances Towards Theories has several accepted answers, such as:

  • The stance of theory acceptance can be taken towards theories.
  • The stance of theory pursuit can be taken towards theories.
  • The stance of theory use can be taken towards theories.

The value of Formulation Text will be:

  • The stances of theory acceptance, theory pursuit, and theory use can be taken towards theories.

If the original topic has no multiple answer formula, all the answers will be added one after another in one record; since each formulation text is a full sentence, a space will be added as a separator.

If no theory is found that answers the question, its superquestions or its subquestions, an empty subobject is created with:

  • Completeness = None.
  • Directness = None.

The following algorithm is used to decide which superanswers and subanswers to count and create subobjects for:

Counting Superanswers Subanswers Activity Diagram 2024.png

There are three main scenarios, visualized in the following diagram:

Counting Superanswers Subanswers Chart 2024.png

NOTE: As any "set" template, it doesn't print anything on the page, but merely sets the appropriate values.


Parameters:

  • |topic= - the full page name of the topic.
  • |subfield= - e.g. Ontology, Dynamics.