<input type="hidden" name="@_RESERVED__PROBLEM_ID_@" value="@_RESERVED__PROBLEM_ID_VAL_@">
<div class="form_line">
<label class="form_label_ac" for="@_ANSWER_PH_@">pH:</label>
- <input class="form_input_ac" type="text" name="@_ANSWER_PH_@" maxlength="128" value="" />
+ <input class="form_input_ac" type="text" name="@_ANSWER_PH_@" maxlength="128" value="@_FILLIN_ANSWER_@" />
</div>
<div class="form_line">
<label class="form_label_ac" for="@_ANSWER_SIMPLIFICATION_@">Lze zanedbat:</label>
<input type="hidden" name="@_RESERVED__PROBLEM_ID_@" value="@_RESERVED__PROBLEM_ID_VAL_@">
<div class="form_line">
<label class="form_label_sol" for="ANSWER_NUM">Výsledek:</label>
- <input class="form_input_sol" type="text" name="ANSWER_NUM" maxlength="128" value="" />
+ <input class="form_input_sol" type="text" name="ANSWER_NUM" maxlength="128" value="@_FILLIN_ANSWER_@" />
</div>
<div class="form_line">
<input type="submit" name="send_answer" value="Zkontrolovat" />
</div>
<div class="form_line">
<label class="form_label_ac" for="@_ANSWER_PH_START_@">pH:</label>
- <input class="form_input_ac" type="text" name="@_ANSWER_PH_START_@" maxlength="128" value="" />
+ <input class="form_input_ac" type="text" name="@_ANSWER_PH_START_@" maxlength="128" value="@_FILLIN_1_PH_@" />
</div>
<div class="form_line">
</div>
<div class="form_line">
<label class="form_label_ac" for="@_ANSWER_PH_FIRST_HALF_@">pH:</label>
- <input class="form_input_ac" type="text" name="@_ANSWER_PH_FIRST_HALF_@" maxlength="128" value="" />
+ <input class="form_input_ac" type="text" name="@_ANSWER_PH_FIRST_HALF_@" maxlength="128" value="@_FILLIN_2_PH_@" />
<label class="form_label_ac" for="@_ANSWER_VOLUME_FIRST_HALF_@">Objem [mL]:</label>
- <input class="form_input_ac" type="text" name="@_ANSWER_VOLUME_FIRST_HALF_@" maxlength="128" value="" />
+ <input class="form_input_ac" type="text" name="@_ANSWER_VOLUME_FIRST_HALF_@" maxlength="128" value="@_FILLIN_2_VOL_@" />
</div>
<div class="form_line">
</div>
<div class="form_line">
<label class="form_label_ac" for="@_ANSWER_PH_FIRST_EQUIV_@">pH:</label>
- <input class="form_input_ac" type="text" name="@_ANSWER_PH_FIRST_EQUIV_@" maxlength="128" value="" />
+ <input class="form_input_ac" type="text" name="@_ANSWER_PH_FIRST_EQUIV_@" maxlength="128" value="@_FILLIN_3_PH_@" />
<label class="form_label_ac" for="@_ANSWER_VOLUME_FIRST_EQUIV_@">Objem [mL]:</label>
- <input class="form_input_ac" type="text" name="@_ANSWER_VOLUME_FIRST_EQUIV_@" maxlength="128" value="" />
+ <input class="form_input_ac" type="text" name="@_ANSWER_VOLUME_FIRST_EQUIV_@" maxlength="128" value="@_FILLIN_3_VOL_@" />
</div>
<div class="form_line">
</div>
<div class="form_line">
<label class="form_label_ac" for="@_ANSWER_PH_SECOND_HALF_@">pH:</label>
- <input class="form_input_ac" type="text" name="@_ANSWER_PH_SECOND_HALF_@" maxlength="128" value="" />
+ <input class="form_input_ac" type="text" name="@_ANSWER_PH_SECOND_HALF_@" maxlength="128" value="@_FILLIN_4_PH_@" />
<label class="form_label_ac" for="@_ANSWER_VOLUME_SECOND_HALF_@">Objem [mL]:</label>
- <input class="form_input_ac" type="text" name="@_ANSWER_VOLUME_SECOND_HALF_@" maxlength="128" value="" />
+ <input class="form_input_ac" type="text" name="@_ANSWER_VOLUME_SECOND_HALF_@" maxlength="128" value="@_FILLIN_4_VOL_@" />
</div>
<div class="form_line">
</div>
<div class="form_line">
<label class="form_label_ac" for="@_ANSWER_PH_SECOND_EQUIV_@">pH:</label>
- <input class="form_input_ac" type="text" name="@_ANSWER_PH_SECOND_EQUIV_@" maxlength="128" value="" />
+ <input class="form_input_ac" type="text" name="@_ANSWER_PH_SECOND_EQUIV_@" maxlength="128" value="@_FILLIN_5_PH_@" />
<label class="form_label_ac" for="@_ANSWER_VOLUME_SECOND_EQUIV_@">Objem [mL]:</label>
- <input class="form_input_ac" type="text" name="@_ANSWER_VOLUME_SECOND_EQUIV_@" maxlength="128" value="" />
+ <input class="form_input_ac" type="text" name="@_ANSWER_VOLUME_SECOND_EQUIV_@" maxlength="128" value="@_FILLIN_5_VOL_@" />
</div>
<div class="form_line">
</div>
<div class="form_line">
<label class="form_label_ac" for="@_ANSWER_PH_OVER_SECOND_EQUIV_@">pH:</label>
- <input class="form_input_ac" type="text" name="@_ANSWER_PH_OVER_SECOND_EQUIV_@" maxlength="128" value="" />
+ <input class="form_input_ac" type="text" name="@_ANSWER_PH_OVER_SECOND_EQUIV_@" maxlength="128" value="@_FILLIN_6_PH_@" />
<label class="form_label_ac" for="@_ANSWER_VOLUME_OVER_SECOND_EQUIV_@">Objem [mL]:</label>
- <input class="form_input_ac" type="text" name="@_ANSWER_VOLUME_OVER_SECOND_EQUIV_@" maxlength="128" value="" />
+ <input class="form_input_ac" type="text" name="@_ANSWER_VOLUME_OVER_SECOND_EQUIV_@" maxlength="128" value="@_FILLIN_6_VOL_@" />
</div>
<div class="form_line">
in Problem_Generator_Syswides.Parameters_Info.Map;
HTML: out HTML_Code;
Pr_ID: in String; Pr_Cat: in String) return RetCode is
+ FillIns: constant Problem_Generator_Syswides.FillIns_Map.Map := Problem_Generator_Syswides.FillIns_Map.Empty_Map;
begin
return Generate_Face_With_Answer(Assignment => Assignment, Parameters => Parameters, HTML => HTML,
Answer_Message => To_UB_Text(""), Answer_Code => Problem_Generator_Syswides.Invalid_Answer,
- Pr_ID => Pr_ID, Pr_Cat => Pr_Cat);
+ Pr_ID => Pr_ID, Pr_Cat => Pr_Cat,
+ FillIns => FillIns);
end Generate_Face;
function Generate_Face_With_Answer(Assignment: in Problem_Generator_Syswides.Assignment_Info.Map;
Answer_Message: in UB_Text;
Answer_Code: in Problem_Generator_Syswides.Answer_RetCode;
Parameters: in Problem_Generator_Syswides.Parameters_Info.Map;
- HTML: out HTML_Code; Pr_ID: in String; Pr_Cat: in String) return RetCode is
+ HTML: out HTML_Code; Pr_ID: in String; Pr_Cat: in String;
+ FillIns: in Problem_Generator_Syswides.FillIns_Map.Map) return RetCode is
use Problem_Generator_Syswides;
use Problem_Generator_Syswides.Assignment_Info;
Problem_Type_Str: constant String := Assignment.Element(PROBLEM_TYPE_KEY);
begin
if Problem_Type_Str = PROBLEM_TYPE_ACIDOBAZIC then
- return Generate_Face_Acidobazic(Assignment, Answer_Message, Answer_Code, Parameters, HTML, Pr_ID, Pr_Cat);
+ return Generate_Face_Acidobazic(Assignment, Answer_Message, Answer_Code, Parameters, HTML, Pr_ID, Pr_Cat, FillIns);
elsif Problem_Type_Str = PROBLEM_TYPE_SOLUBILITY then
- return Generate_Face_Solubility(Assignment, Answer_Message, Answer_Code, Parameters, HTML, Pr_ID, Pr_Cat);
+ return Generate_Face_Solubility(Assignment, Answer_Message, Answer_Code, Parameters, HTML, Pr_ID, Pr_Cat, FillIns);
elsif Problem_Type_Str = PROBLEM_TYPE_TITRATION_CURVE then
- return Generate_Face_Titration_Curve(Assignment, Answer_Message, Answer_Code, Parameters, HTML, Pr_ID, Pr_Cat);
+ return Generate_Face_Titration_Curve(Assignment, Answer_Message, Answer_Code, Parameters, HTML, Pr_ID, Pr_Cat, FillIns);
else
return E_INVAL;
end if;
Answer_Message: in UB_Text;
Answer_Code: in Problem_Generator_Syswides.Answer_RetCode;
Parameters: in Problem_Generator_Syswides.Parameters_Info.Map;
- HTML: out HTML_Code; Pr_ID: in String; Pr_Cat: in String) return RetCode is
+ HTML: out HTML_Code; Pr_ID: in String; Pr_Cat: in String;
+ FillIns: in Problem_Generator_Syswides.FillIns_Map.Map) return RetCode is
use AWS.Templates;
use Problem_Generator_Syswides;
use Problem_Generator_Syswides.Assignment_Info;
+ use Problem_Generator_Syswides.FillIns_Map;
use Problem_Generator_Syswides.Parameters_Info;
Translations_Hdr: Translate_Set;
Add_Answer_Section(Translations, Answer_Message, Answer_Code);
+ -- Add FillIns
+ if FillIns.Is_Empty = False then
+ if FillIns.Find(Acidobazic_Suite.FILLIN_ANSWER_KEY) = FillIns_Map.No_Element then
+ return E_INVAL;
+ end if;
+ Insert(Translations, Assoc(Acidobazic_Suite.FILLIN_ANSWER_KEY, FillIns.Element(Acidobazic_Suite.FILLIN_ANSWER_KEY)));
+ end if;
+
-- Generate hints
if Assignment.Element(Acidobazic_Suite.PKX_KEY) = Acidobazic_Suite.PKX_PKA_TEXT then
Temp := Parse(Filename => "templates/hints_acidobazic_acid.html", Cached => True);
Answer_Message: in UB_Text;
Answer_Code: in Problem_Generator_Syswides.Answer_RetCode;
Parameters: in Problem_Generator_Syswides.Parameters_Info.Map;
- HTML: out HTML_Code; Pr_ID: in String; Pr_Cat: in String) return RetCode is
+ HTML: out HTML_Code; Pr_ID: in String; Pr_Cat: in String;
+ FillIns: in Problem_Generator_Syswides.FillIns_Map.Map) return RetCode is
use Ada.Strings.Unbounded;
use AWS.Templates;
use Problem_Generator_Syswides;
use Problem_Generator_Syswides.Assignment_Info;
+ use Problem_Generator_Syswides.FillIns_Map;
use Problem_Generator_Syswides.Parameters_Info;
Translations_Hdr: Translate_Set;
-- - Mandatory parameters
Insert(Translations_Submit, Assoc(RESERVED_PROBLEM_ID_KEY, RESERVED_PROBLEM_ID_KEY));
Insert(Translations_Submit, Assoc(RESERVED_PROBLEM_ID_VAL_KEY, Pr_ID));
+ -- Add FillIns
+ if FillIns.Is_Empty = False then
+ if FillIns.Find(Solubility_Suite.FILLIN_ANSWER_KEY) = FillIns_Map.No_Element then
+ return E_INVAL;
+ end if;
+ Insert(Translations_Submit, Assoc(Solubility_Suite.FILLIN_ANSWER_KEY, FillIns.Element(Solubility_Suite.FILLIN_ANSWER_KEY)));
+ end if;
--
Temp := Parse(Filename => "templates/face_solubility_submit.html", Translations => Translations_Submit);
Insert(Translations, Assoc("SUBMIT_FORM", HTML_To_Fixed_String(Temp)));
-- Put the processed parameters template into the face
Insert(Translations, Assoc("PARAMETERS_FORM", HTML_To_Fixed_String(Params_Code)));
-
if P_Subtype = Solubility_Suite.PROBLEM_SUBTYPE_V_FROM_G_KS then
-- Check that we have all necessary fields in the assignment
if Assignment.Find(Solubility_Suite.X_STOCHIO_KEY) = Assignment_Info.No_Element then
Answer_Message: in UB_Text;
Answer_Code: in Problem_Generator_Syswides.Answer_RetCode;
Parameters: in Problem_Generator_Syswides.Parameters_Info.Map;
- HTML: out HTML_Code; Pr_ID: in String; Pr_Cat: in String) return RetCode is
+ HTML: out HTML_Code; Pr_ID: in String; Pr_Cat: in String;
+ FillIns: in Problem_Generator_Syswides.FillIns_Map.Map) return RetCode is
use AWS.Templates;
use Problem_Generator_Syswides;
use Problem_Generator_Syswides.Assignment_Info;
+ use Problem_Generator_Syswides.FillIns_Map;
use Problem_Generator_Syswides.Parameters_Info;
Translations_Hdr: Translate_Set;
Insert(Translations, Assoc(ANSWER_SECTION_KEY, ""));
end case;
+ -- Add FillIns
+ if FillIns.Is_Empty = False then
+ if FillIns.Find(Titration_Curve_Suite.FILLIN_1_PH_KEY) = FillIns_Map.No_Element then
+ return E_INVAL;
+ end if;
+ Insert(Translations, Assoc(Titration_Curve_Suite.FILLIN_1_PH_KEY, FillIns.Element(Titration_Curve_Suite.FILLIN_1_PH_KEY)));
+ if FillIns.Find(Titration_Curve_Suite.FILLIN_2_PH_KEY) = FillIns_Map.No_Element then
+ return E_INVAL;
+ end if;
+ Insert(Translations, Assoc(Titration_Curve_Suite.FILLIN_2_PH_KEY, FillIns.Element(Titration_Curve_Suite.FILLIN_2_PH_KEY)));
+ if FillIns.Find(Titration_Curve_Suite.FILLIN_3_PH_KEY) = FillIns_Map.No_Element then
+ return E_INVAL;
+ end if;
+ Insert(Translations, Assoc(Titration_Curve_Suite.FILLIN_3_PH_KEY, FillIns.Element(Titration_Curve_Suite.FILLIN_3_PH_KEY)));
+ if FillIns.Find(Titration_Curve_Suite.FILLIN_4_PH_KEY) = FillIns_Map.No_Element then
+ return E_INVAL;
+ end if;
+ Insert(Translations, Assoc(Titration_Curve_Suite.FILLIN_4_PH_KEY, FillIns.Element(Titration_Curve_Suite.FILLIN_4_PH_KEY)));
+ if FillIns.Find(Titration_Curve_Suite.FILLIN_5_PH_KEY) = FillIns_Map.No_Element then
+ return E_INVAL;
+ end if;
+ Insert(Translations, Assoc(Titration_Curve_Suite.FILLIN_5_PH_KEY, FillIns.Element(Titration_Curve_Suite.FILLIN_5_PH_KEY)));
+ if FillIns.Find(Titration_Curve_Suite.FILLIN_6_PH_KEY) = FillIns_Map.No_Element then
+ return E_INVAL;
+ end if;
+ Insert(Translations, Assoc(Titration_Curve_Suite.FILLIN_6_PH_KEY, FillIns.Element(Titration_Curve_Suite.FILLIN_6_PH_KEY)));
+ --
+ if FillIns.Find(Titration_Curve_Suite.FILLIN_2_VOL_KEY) = FillIns_Map.No_Element then
+ return E_INVAL;
+ end if;
+ Insert(Translations, Assoc(Titration_Curve_Suite.FILLIN_2_VOL_KEY, FillIns.Element(Titration_Curve_Suite.FILLIN_2_VOL_KEY)));
+ if FillIns.Find(Titration_Curve_Suite.FILLIN_3_VOL_KEY) = FillIns_Map.No_Element then
+ return E_INVAL;
+ end if;
+ Insert(Translations, Assoc(Titration_Curve_Suite.FILLIN_3_VOL_KEY, FillIns.Element(Titration_Curve_Suite.FILLIN_3_VOL_KEY)));
+ if FillIns.Find(Titration_Curve_Suite.FILLIN_4_VOL_KEY) = FillIns_Map.No_Element then
+ return E_INVAL;
+ end if;
+ Insert(Translations, Assoc(Titration_Curve_Suite.FILLIN_4_VOL_KEY, FillIns.Element(Titration_Curve_Suite.FILLIN_4_VOL_KEY)));
+ if FillIns.Find(Titration_Curve_Suite.FILLIN_5_VOL_KEY) = FillIns_Map.No_Element then
+ return E_INVAL;
+ end if;
+ Insert(Translations, Assoc(Titration_Curve_Suite.FILLIN_5_VOL_KEY, FillIns.Element(Titration_Curve_Suite.FILLIN_5_VOL_KEY)));
+ if FillIns.Find(Titration_Curve_Suite.FILLIN_6_VOL_KEY) = FillIns_Map.No_Element then
+ return E_INVAL;
+ end if;
+ Insert(Translations, Assoc(Titration_Curve_Suite.FILLIN_6_VOL_KEY, FillIns.Element(Titration_Curve_Suite.FILLIN_6_VOL_KEY)));
+ end if;
+
+
Temp := Parse(Filename => "templates/face_titration_curve.html", Translations => Translations);
Append_HTML(Source => HTML, New_Item => Temp);
Answer_Code: in Problem_Generator_Syswides.Answer_RetCode;
Parameters: in Problem_Generator_Syswides.Parameters_Info.Map;
HTML: out HTML_Code;
- Pr_ID: in String; Pr_Cat: in String) return RetCode;
+ Pr_ID: in String; Pr_Cat: in String;
+ FillIns: in Problem_Generator_Syswides.FillIns_Map.Map) return RetCode;
private
procedure Add_Answer_Section(Translations: in out AWS.Templates.Translate_Set; Answer_Message: in UB_Text;
Answer_Code: in Problem_Generator_Syswides.Answer_RetCode;
Parameters: in Problem_Generator_Syswides.Parameters_Info.Map;
HTML: out HTML_Code;
- Pr_ID: in String; Pr_Cat: in String) return RetCode;
+ Pr_ID: in String; Pr_Cat: in String;
+ FillIns: in Problem_Generator_Syswides.FillIns_Map.Map) return RetCode;
function Generate_Face_Solubility(Assignment: in Problem_Generator_Syswides.Assignment_Info.Map;
Answer_Message: in UB_Text;
Answer_Code: in Problem_Generator_Syswides.Answer_RetCode;
Parameters: in Problem_Generator_Syswides.Parameters_Info.Map;
HTML: out HTML_Code;
- Pr_ID: in String; Pr_Cat: in String) return RetCode;
+ Pr_ID: in String; Pr_Cat: in String;
+ FillIns: in Problem_Generator_Syswides.FillIns_Map.Map) return RetCode;
function Generate_Face_Titration_Curve(Assignment: in Problem_Generator_Syswides.Assignment_Info.Map;
Answer_Message: in UB_Text;
Answer_Code: in Problem_Generator_Syswides.Answer_RetCode;
Parameters: in Problem_Generator_Syswides.Parameters_Info.Map;
HTML: out HTML_Code;
- Pr_ID: in String; Pr_Cat: in String) return RetCode;
+ Pr_ID: in String; Pr_Cat: in String;
+ FillIns: in Problem_Generator_Syswides.FillIns_Map.Map) return RetCode;
ERROR_MESSAGE_KEY: constant String := "ERROR_MESSAGE";
HEADER_CAPTION_KEY: constant String := "HEADER_CAPTION";
return Problem;
end Create;
- function Check_Answer(Problem: in out Acidobazic_Problem; Answer: in Answer_Info.Map;
+ function Check_Answer(Problem: in out Acidobazic_Problem; Answer: in Answer_Info.Map; FillIns: in out FillIns_Map.Map;
Message: out UB_Text) return Answer_RetCode is
package FH is new Formatting_Helpers(pH_Float);
use Answer_Info;
return Malformed_Answer;
end;
+ -- Prepare FillIns
+ FillIns.Insert(FILLIN_ANSWER_KEY, Answer.Element(ANSWER_PH_KEY));
+
-- Check correctness of simplification
declare
Simplification_Str: constant String := Answer.Element(ANSWER_SIMPLIFICATION_KEY);
return Problem;
end;
- function Check_Answer(Problem: in out Solubility_Problem; Answer: in Answer_Info.Map; Message: out UB_Text) return Answer_RetCode is
+ function Check_Answer(Problem: in out Solubility_Problem; Answer: in Answer_Info.Map; FillIns: in out FillIns_Map.Map; Message: out UB_Text) return Answer_RetCode is
package FH is new Formatting_Helpers(SS_Float);
use Answer_Info;
use FH;
Message := To_UB_Text("Nesprávně zadaná odpověď");
return Malformed_Answer;
end;
+ -- Prepare FillIns
+ FillIns.Insert(FILLIN_ANSWER_KEY, Answer.Element(ANSWER_NUM_KEY));
Split_Integer_Decimal_Exponent_Strs(AF, DECIMALS, Int_Part_A_Str, Dec_Part_A_Str, Exp_Part_A_Str);
Split_Integer_Decimal_Exponent_Strs(Problem.Answer_Num, DECIMALS, Int_Part_C_Str, Dec_Part_C_Str, Exp_Part_C_Str);
return Problem;
end Create;
- function Check_Answer(Problem: in out Titration_Curve_Problem; Answer: in Answer_Info.Map;
+ function Check_Answer(Problem: in out Titration_Curve_Problem; Answer: in Answer_Info.Map; FillIns: in out FillIns_Map.Map;
Message: out UB_Text) return Answer_RetCode is
package FH is new Formatting_Helpers(T_Float);
package TFEF is new Ada.Numerics.Generic_Elementary_Functions(T_Float);
Status_Out := Cairo.Png.Write_To_Png(Surface, Ada.Strings.Unbounded.To_String(Problem.Resource_Prefix) & TITRATION_CURVE_FILENAME);
Message := To_UB_Text("");
+
+ -- Prepare FillIns
+ FillIns.Insert(FILLIN_1_PH_KEY, Answer.Element(ANSWER_PH_START_KEY));
+ FillIns.Insert(FILLIN_2_PH_KEY, Answer.Element(ANSWER_PH_FIRST_HALF_KEY));
+ FillIns.Insert(FILLIN_3_PH_KEY, Answer.Element(ANSWER_PH_FIRST_EQUIV_KEY));
+ FillIns.Insert(FILLIN_4_PH_KEY, Answer.Element(ANSWER_PH_SECOND_HALF_KEY));
+ FillIns.Insert(FILLIN_5_PH_KEY, Answer.Element(ANSWER_PH_SECOND_EQUIV_KEY));
+ FillIns.Insert(FILLIN_6_PH_KEY, Answer.Element(ANSWER_PH_OVER_SECOND_EQUIV_KEY));
+ --
+ FillIns.Insert(FILLIN_2_VOL_KEY, Answer.Element(ANSWER_VOLUME_FIRST_HALF_KEY));
+ FillIns.Insert(FILLIN_3_VOL_KEY, Answer.Element(ANSWER_VOLUME_FIRST_EQUIV_KEY));
+ FillIns.Insert(FILLIN_4_VOL_KEY, Answer.Element(ANSWER_VOLUME_SECOND_HALF_KEY));
+ FillIns.Insert(FILLIN_5_VOL_KEY, Answer.Element(ANSWER_VOLUME_SECOND_EQUIV_KEY));
+ FillIns.Insert(FILLIN_6_VOL_KEY, Answer.Element(ANSWER_VOLUME_OVER_SECOND_EQUIV_KEY));
+
return Correct_Answer;
end Check_Answer;
type Chem_Problem is abstract limited new Ada.Finalization.Limited_Controlled with private;
function Create return access Chem_Problem is abstract;
- function Check_Answer(Problem: in out Chem_Problem; Answer: in Answer_Info.Map; Message: out UB_Text) return Answer_RetCode is abstract;
+ function Check_Answer(Problem: in out Chem_Problem; Answer: in Answer_Info.Map; FillIns: in out FillIns_Map.Map; Message: out UB_Text) return Answer_RetCode is abstract;
function Get_Assignment(Problem: in out Chem_Problem; Assignment: in out Assignment_Info.Map; Resource_Prefix: in String) return RetCode is abstract;
function Get_Parameters(Problem: in out Chem_Problem; Parameters: out Parameters_Info.Map) return RetCode is abstract;
procedure New_Problem(Problem: in out Chem_Problem) is abstract;
-- Constructor
function Create return access Acidobazic_Problem;
-- Inherited
- function Check_Answer(Problem: in out Acidobazic_Problem; Answer: in Answer_Info.Map; Message: out UB_Text) return Answer_RetCode;
+ function Check_Answer(Problem: in out Acidobazic_Problem; Answer: in Answer_Info.Map; FillIns: in out FillIns_Map.Map; Message: out UB_Text) return Answer_RetCode;
procedure New_Problem(Problem: in out Acidobazic_Problem);
function Get_Assignment(Problem: in out Acidobazic_Problem; Assignment: in out Assignment_Info.Map; Resource_Prefix: in String) return RetCode;
function Get_Parameters(Problem: in out Acidobazic_Problem; Parameters: out Parameters_Info.Map) return RetCode;
-- Constructor
function Create return access Solubility_Problem;
-- Inherited
- function Check_Answer(Problem: in out Solubility_Problem; Answer: in Answer_Info.Map; Message: out UB_Text) return Answer_RetCode;
+ function Check_Answer(Problem: in out Solubility_Problem; Answer: in Answer_Info.Map; FillIns: in out FillIns_Map.Map; Message: out UB_Text) return Answer_RetCode;
procedure New_Problem(Problem: in out Solubility_Problem);
function Get_Assignment(Problem: in out Solubility_Problem; Assignment: in out Assignment_Info.Map; Resource_Prefix: in String) return RetCode;
function Get_Parameters(Problem: in out Solubility_Problem; Parameters: out Parameters_Info.Map) return RetCode;
-- Constructor
function Create return access Titration_Curve_Problem;
-- Inherited
- function Check_Answer(Problem: in out Titration_Curve_Problem; Answer: in Answer_Info.Map; Message: out UB_Text) return Answer_RetCode;
+ function Check_Answer(Problem: in out Titration_Curve_Problem; Answer: in Answer_Info.Map; FillIns: in out FillIns_Map.Map; Message: out UB_Text) return Answer_RetCode;
function Get_Assignment(Problem: in out Titration_Curve_Problem; Assignment: in out Assignment_Info.Map; Resource_Prefix: in String) return RetCode;
function Get_Parameters(Problem: in out Titration_Curve_Problem; Parameters: out Parameters_Info.Map) return RetCode;
procedure New_Problem(Problem: in out Titration_Curve_Problem);
type Problem_Type is (Acidobazic, Solubility, Titration_Curve);
package Answer_Info is new Ada.Containers.Indefinite_Ordered_Maps(String, String);
package Assignment_Info is new Ada.Containers.Indefinite_Ordered_Maps(String, String);
+ package FillIns_Map is new Ada.Containers.Indefinite_Ordered_Maps(String, String);
package Parameters_Info is new Ada.Containers.Indefinite_Ordered_Maps(String, String);
ANSWER_KIND_KEY: constant String := "ANSWER_KIND";
ANSWER_SIMPLIFICATION_KEY: constant String := "ANSWER_SIMPLIFICATION";
--
PARAMETER_NO_BOTH_SIMPLIFICATIONS_KEY: constant String := "PARAMETER_NO_BOTH_SIMPLIFICATIONS";
+ --
+ FILLIN_ANSWER_KEY: constant String := "FILLIN_ANSWER";
end Acidobazic_Suite;
package Solubility_Suite is
--
PARAMETER_IONIC_STRENGTH_KEY: constant String := "PARAMETER_IONIC_STRENGTH";
PARAMETER_PROBLEM_SUBTYPE_KEY: constant String := "PARAMETER_PROBLEM_SUBTYPE";
+ --
+ FILLIN_ANSWER_KEY: constant String := "FILLIN_ANSWER";
end Solubility_Suite;
TITRATION_CURVE_IMAGE_CLASS_NODISP: constant String := "hidden_image";
TITRATION_CURVE_IMAGE_CLASS_NORM: constant String := "titration_curve_image";
TITRATION_CURVE_IMAGE_PATH_KEY: constant String := "TITRATION_CURVE_IMAGE_PATH";
+ --
+ FILLIN_1_PH_KEY: constant String := "FILLIN_1_PH";
+ FILLIN_2_PH_KEY: constant String := "FILLIN_2_PH";
+ FILLIN_2_VOL_KEY: constant String := "FILLIN_2_VOL";
+ FILLIN_3_PH_KEY: constant String := "FILLIN_3_PH";
+ FILLIN_3_VOL_KEY: constant String := "FILLIN_3_VOL";
+ FILLIN_4_PH_KEY: constant String := "FILLIN_4_PH";
+ FILLIN_4_VOL_KEY: constant String := "FILLIN_4_VOL";
+ FILLIN_5_PH_KEY: constant String := "FILLIN_5_PH";
+ FILLIN_5_VOL_KEY: constant String := "FILLIN_5_VOL";
+ FILLIN_6_PH_KEY: constant String := "FILLIN_6_PH";
+ FILLIN_6_VOL_KEY: constant String := "FILLIN_6_VOL";
end Titration_Curve_Suite;
Answer_Message: UB_Text;
ARC: Problem_Generator_Syswides.Answer_RetCode;
Assignment: Problem_Generator_Syswides.Assignment_Info.Map;
+ FillIns: Problem_Generator_Syswides.Fillins_Map.Map;
Parameters: Problem_Generator_Syswides.Parameters_Info.Map;
Pr_Cat: Problem_Category;
Ret: RetCode;
end;
begin
- ARC := Stored.Problem.Check_Answer(Answer, Answer_Message);
+ ARC := Stored.Problem.Check_Answer(Answer, FillIns, Answer_Message);
exception
when Ex: others =>
Stored.Mutex.Unlock;
Stored.Mutex.Unlock;
return Face_Generator.Generate_Face_With_Answer(Assignment => Assignment, Answer_Message => Answer_Message,
Answer_Code => ARC, HTML => HTML,
- Parameters => Parameters, Pr_ID => Problem_ID'Image(Pr_ID), Pr_Cat => Problem_Category'Image(Pr_Cat));
+ Parameters => Parameters, Pr_ID => Problem_ID'Image(Pr_ID), Pr_Cat => Problem_Category'Image(Pr_Cat),
+ FillIns => FillIns);
end Display_Checked_Answer;
function Display_Assignment(UID: in Unique_ID; HTML: out HTML_Code) return RetCode is