begin
return Generate_Face_Internal(Mode => Answer_Mode,
Assignment => Assignment, Parameters => Parameters, HTML => HTML,
- Answer_Message => To_UB_Text(""), Answer_Code => Problem_Generator_Syswides.Invalid_Answer,
+ Answer_Message => Answer_Message, Answer_Code => Answer_Code,
Pr_ID => Pr_ID, Pr_Cat => Pr_Cat,
FillIns => FillIns,
Walkthrough => Walkthrough);
Temp := Parse(Filename => "scripts/expand_collapse.js", Cached => True);
Append_HTML(Source => HTML, New_Item => Temp);
- Add_Answer_Section(Translations, Answer_Message, Answer_Code);
+ case Mode is
+ when Answer_Mode =>
+ Add_Answer_Section(Translations, Answer_Message, Answer_Code);
+ when others =>
+ null;
+ end case;
-- Add submit section
-- - Mandatory parameters
end if;
Insert(Translations, Assoc(HINTS_SECTION_KEY, HTML_To_Fixed_String(Temp)));
- case Answer_Code is
- when Correct_Answer =>
- if Assignment.Find(Titration_Curve_Suite.TITRATION_CURVE_IMAGE_PATH_KEY) = Assignment_Info.No_Element then
- return E_INVAL;
- end if;
-
- Insert(Translations_Answer, Assoc(ANSWER_KIND_KEY, ANSWER_KIND_GOOD));
- Insert(Translations_Answer, Assoc(ANSWER_MESSAGE_KEY, UB_Text_To_Fixed_String(Answer_Message)));
- Insert(Translations_Answer, Assoc(Titration_Curve_Suite.TITRATION_CURVE_IMAGE_PATH_KEY, Assignment.Element(Titration_Curve_Suite.TITRATION_CURVE_IMAGE_PATH_KEY)));
- Insert(Translations_Answer, Assoc(Titration_Curve_Suite.TITRATION_CURVE_IMAGE_CLASS_KEY, Titration_Curve_Suite.TITRATION_CURVE_IMAGE_CLASS_NORM));
- Temp := Parse(Filename => "templates/titration_curve_answer_section.html", Translations => Translations_Answer);
- Insert(Translations, Assoc(ANSWER_SECTION_KEY, HTML_To_Fixed_String(Temp)));
- when Wrong_Answer | Malformed_Answer =>
- Insert(Translations_Answer, Assoc(ANSWER_KIND_KEY, ANSWER_KIND_BAD));
- Insert(Translations_Answer, Assoc(ANSWER_MESSAGE_KEY, UB_Text_To_Fixed_String(Answer_Message)));
- Insert(Translations_Answer, Assoc(Titration_Curve_Suite.TITRATION_CURVE_IMAGE_PATH_KEY, "/resources/noimage.png"));
- Insert(Translations_Answer, Assoc(Titration_Curve_Suite.TITRATION_CURVE_IMAGE_CLASS_KEY, Titration_Curve_Suite.TITRATION_CURVE_IMAGE_CLASS_NODISP));
- Temp := Parse(Filename => "templates/titration_curve_answer_section.html", Translations => Translations_Answer);
- Insert(Translations, Assoc(ANSWER_SECTION_KEY, HTML_To_Fixed_String(Temp)));
+ case Mode is
+ when Answer_Mode =>
+ case Answer_Code is
+ when Correct_Answer =>
+ if Assignment.Find(Titration_Curve_Suite.TITRATION_CURVE_IMAGE_PATH_KEY) = Assignment_Info.No_Element then
+ return E_INVAL;
+ end if;
+
+ Insert(Translations_Answer, Assoc(ANSWER_KIND_KEY, ANSWER_KIND_GOOD));
+ Insert(Translations_Answer, Assoc(ANSWER_MESSAGE_KEY, UB_Text_To_Fixed_String(Answer_Message)));
+ Insert(Translations_Answer, Assoc(Titration_Curve_Suite.TITRATION_CURVE_IMAGE_PATH_KEY, Assignment.Element(Titration_Curve_Suite.TITRATION_CURVE_IMAGE_PATH_KEY)));
+ Insert(Translations_Answer, Assoc(Titration_Curve_Suite.TITRATION_CURVE_IMAGE_CLASS_KEY, Titration_Curve_Suite.TITRATION_CURVE_IMAGE_CLASS_NORM));
+ Temp := Parse(Filename => "templates/titration_curve_answer_section.html", Translations => Translations_Answer);
+ Insert(Translations, Assoc(ANSWER_SECTION_KEY, HTML_To_Fixed_String(Temp)));
+ when Wrong_Answer | Malformed_Answer =>
+ Insert(Translations_Answer, Assoc(ANSWER_KIND_KEY, ANSWER_KIND_BAD));
+ Insert(Translations_Answer, Assoc(ANSWER_MESSAGE_KEY, UB_Text_To_Fixed_String(Answer_Message)));
+ Insert(Translations_Answer, Assoc(Titration_Curve_Suite.TITRATION_CURVE_IMAGE_PATH_KEY, "/resources/noimage.png"));
+ Insert(Translations_Answer, Assoc(Titration_Curve_Suite.TITRATION_CURVE_IMAGE_CLASS_KEY, Titration_Curve_Suite.TITRATION_CURVE_IMAGE_CLASS_NODISP));
+ Temp := Parse(Filename => "templates/titration_curve_answer_section.html", Translations => Translations_Answer);
+ Insert(Translations, Assoc(ANSWER_SECTION_KEY, HTML_To_Fixed_String(Temp)));
+ when others =>
+ Insert(Translations, Assoc(ANSWER_SECTION_KEY, ""));
+ end case;
when others =>
Insert(Translations, Assoc(ANSWER_SECTION_KEY, ""));
end case;