/*
 * Generated by the Jasper component of Apache Tomcat
 * Version: JspC/ApacheTomcat9
 * Generated at: 2025-11-09 20:29:18 UTC
 * Note: The last modified time of this file was set to
 *       the last modified time of the source file after
 *       generation to assist with modification tracking.
 */
package org.apache.jsp.quizz.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.silverpeas.kernel.util.StringUtil;
import org.silverpeas.core.util.WebEncodeHelper;
import org.silverpeas.core.util.file.FileUploadUtil;
import org.silverpeas.core.util.URLUtil;
import org.silverpeas.core.util.MultiSilverpeasBundle;
import org.silverpeas.core.admin.user.model.UserDetail;
import org.silverpeas.core.admin.component.model.ComponentInstLight;
import org.silverpeas.components.quizz.QuizzException;
import org.silverpeas.components.quizz.QuestionForm;
import org.silverpeas.components.quizz.QuestionHelper;
import org.silverpeas.core.util.file.FileServerUtils;
import org.silverpeas.core.web.util.viewgenerator.html.GraphicElementFactory;
import org.silverpeas.core.web.util.viewgenerator.html.board.Board;
import org.silverpeas.kernel.bundle.ResourceLocator;
import org.silverpeas.core.questioncontainer.score.model.ScoreDetail;
import org.silverpeas.core.questioncontainer.question.model.Question;
import org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader;
import org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail;
import org.silverpeas.core.questioncontainer.result.model.QuestionResult;
import org.silverpeas.core.web.util.viewgenerator.html.window.Window;
import org.silverpeas.core.web.util.viewgenerator.html.browsebars.BrowseBar;
import org.silverpeas.core.web.util.viewgenerator.html.frame.Frame;
import org.silverpeas.core.web.util.viewgenerator.html.buttons.Button;
import org.silverpeas.core.web.util.viewgenerator.html.buttonpanes.ButtonPane;
import org.silverpeas.core.web.util.viewgenerator.html.iconpanes.IconPane;
import org.silverpeas.core.web.util.viewgenerator.html.icons.Icon;
import org.silverpeas.core.web.util.viewgenerator.html.Encode;
import org.silverpeas.core.util.file.FileRepositoryManager;
import org.silverpeas.core.questioncontainer.answer.model.Answer;
import org.silverpeas.kernel.bundle.SettingBundle;
import org.silverpeas.core.web.util.viewgenerator.html.tabs.TabbedPane;
import org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayPane;
import org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayColumn;
import java.util.Collection;
import java.util.Iterator;
import org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayLine;
import org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayCellText;
import org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayCellLink;
import java.util.Date;
import java.util.List;
import java.util.Vector;
import java.util.Map;
import java.util.HashMap;
import java.io.IOException;
import org.apache.commons.fileupload.FileItem;
import org.silverpeas.components.quizz.control.QuizzSessionController;
import org.silverpeas.core.util.DateUtil;
import org.silverpeas.kernel.bundle.LocalizationBundle;
import java.util.ArrayList;
import org.silverpeas.core.web.util.viewgenerator.html.operationpanes.OperationPane;
import org.silverpeas.core.persistence.jdbc.DBUtil;
import org.silverpeas.core.web.util.viewgenerator.html.GraphicElementFactory;
import org.silverpeas.core.web.util.viewgenerator.html.board.Board;
import org.silverpeas.core.web.util.viewgenerator.html.buttons.Button;
import org.silverpeas.core.web.util.viewgenerator.html.operationpanes.OperationPane;
import org.silverpeas.core.web.util.viewgenerator.html.frame.Frame;
import org.silverpeas.core.web.util.viewgenerator.html.window.Window;
import org.silverpeas.core.util.WebEncodeHelper;

public final class quizzQuestionsNew_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent,
                 org.apache.jasper.runtime.JspSourceImports {


//Display the quizz header
String displayQuizzHeader(QuizzSessionController quizzScc, QuestionContainerHeader quizzHeader, MultiSilverpeasBundle resources, GraphicElementFactory gef) {
  String title = quizzHeader.getTitle();
  String description = quizzHeader.getDescription();
  String comment = quizzHeader.getComment();

  Board board = gef.getBoard();
  String r = "";
  r += board.printBefore();
  r += "<table border=\"0\" cellspacing=\"3\" cellpadding=\"0\" width=\"100%\">";
  r += "<tr><td>";
  r += "<span class=\"titreFenetre\">"+WebEncodeHelper.javaStringToHtmlString(title)+"</span>";
  r += "<blockquote>";
  r += "<span class=\"sousTitreFenetre\">"+WebEncodeHelper.javaStringToHtmlParagraphe(description)+"</span>";
  if (StringUtil.isDefined(comment)) {
    r += "<br><br><span class=txttitrecol>"+resources.getString("QuizzNotice")+"</span>&nbsp;&nbsp;";
    r += WebEncodeHelper.javaStringToHtmlParagraphe(comment)+"";
  }
  r += "</blockquote>";
  r += "</td></tr></table>";
  r += board.printAfter();
  return r;
}

String displayQuizz(QuestionContainerDetail quizz, GraphicElementFactory gef, String m_context, QuizzSessionController quizzScc, MultiSilverpeasBundle resources, SettingBundle settings, JspWriter out) throws QuizzException {
  String r = "";
  Question question = null;
  Collection<Answer> answers = null;
	try{
		if (quizz != null) {
			QuestionContainerHeader quizzHeader = quizz.getHeader();
			Collection<Question> questions = quizz.getQuestions();
			//Display the quizz header
			r += displayQuizzHeader(quizzScc, quizzHeader, resources, gef);

			//Display the questions
			r += "<form name=\"quizz\" Action=\"quizzQuestionsNew.jsp\" Method=\"Post\">";
			r += "<input type=\"hidden\" name=\"Action\">";
			r += "<input type=\"hidden\" name=\"NbQuestions\" value=\""+questions.size()+"\">";
			r += "<input type=\"hidden\" name=\"QuizzId\" value=\""+quizzHeader.getPK().getId()+"\">";

			Iterator<Question> itQ = questions.iterator();
			int i = 1;
			while (itQ.hasNext()) {
				  question = (Question) itQ.next();
				  r += displayQuestion(quizzScc, question, i, m_context, settings, gef, resources);
				  i++;

			}
		} else {
			r += "<table><tr><td>"+resources.getString("QuizzUnavailable")+"</td></tr>";
		}
	} catch (Exception e){
		throw new QuizzException ("quizzQuestionNew_JSP.displayQuizz",QuizzException.WARNING,"Quizz.EX_CANNOT_DISPLAY_QUIZZ",e);
	}

  return r;
}

List<String> displayQuestions(QuestionContainerDetail quizz, int roundId,GraphicElementFactory gef, String m_context,QuizzSessionController quizzScc, MultiSilverpeasBundle resources, SettingBundle settings, Frame frame, JspWriter out) throws QuizzException {
  String r = "";
  String s = "";
  Question question = null;
  List<String> displayQuestions = new ArrayList<String>();
	try{
		if (quizz != null) {
			QuestionContainerHeader quizzHeader = quizz.getHeader();
			int nbQuestionsPerPage = quizzHeader.getNbQuestionsPerPage();
			int end = nbQuestionsPerPage * roundId;
			int begin = end - nbQuestionsPerPage;
			Collection<Question> questions = quizz.getQuestions();
			int nbQuestions = 0;
			if (end <= questions.size()) {
				nbQuestions = nbQuestionsPerPage;
			} else {
				nbQuestions = questions.size() % nbQuestionsPerPage;
      }
			r += displayQuizzHeader(quizzScc, quizzHeader, resources, gef);

			//Display the questions
			r += "<form name=\"quizz\" Action=\"quizzQuestionsNew.jsp\" Method=\"Post\">";
			r += "<input type=\"hidden\" name=\"Action\">";
			r += "<input type=\"hidden\" name=\"RoundId\">";
			r += "<input type=\"hidden\" name=\"NbQuestions\" value=\""+nbQuestions+"\">";
			r += "<input type=\"hidden\" name=\"QuizzId\" value=\""+quizzHeader.getPK().getId()+"\">";
			Iterator<Question> itQ = questions.iterator();
			int i = 1;
			int j = 1;
			while (itQ.hasNext()) {
				  question = (Question) itQ.next();
				  if ((i > begin) && (i <= end)) {
					  r += displayQuestion(quizzScc, question, j, m_context, settings, gef, resources);
					  j++;
				  }
				  i++;
			}
			s += "<table width=\"98%\" border=\"0\" cellspacing=\"2\" cellpadding=\"5\">";
			s += "<tr><td nowrap>";
			s += "<table border=\"0\" cellspacing=\"3\" cellpadding=\"0\" width=\"100%\">";
			s += "<tr><td>";

			Button cancelButton = null;
			Button voteButton = null;
			if ((begin <= 0) && (end < questions.size())) {
				  voteButton = (Button) gef.getFormButton(resources.getString("GML.validate"), "javascript:onClick=sendVote('"+(roundId+1)+"')", false);
				  s += "<tr><td align=\"center\"><table><tr><td class=intfdcolor51 align=center>"+voteButton.print()+"</td></tr></table></td></tr>";
			} else if (end >= questions.size()) {
				  voteButton = (Button) gef.getFormButton(resources.getString("GML.validate"), "javascript:onClick=sendVote('end')", false);
				  s += "<tr><td align=\"center\"><table><tr><td class=intfdcolor51 align=center>"+voteButton.print()+"</td></tr></table></td></tr>";
			} else {
				  voteButton = (Button) gef.getFormButton(resources.getString("GML.validate"), "javascript:onClick=sendVote('"+(roundId+1)+"')", false);
				  s += "<tr><td align=\"center\"><table><tr><td class=intfdcolor51 align=center>"+voteButton.print()+"</td></tr></table></td></tr>";
			}
			 s += "</table>";
			 s += "</td></tr>";
			 s += "</table>";
			 s += "</form>";
		} else {
			r += "<table><tr><td>"+resources.getString("QuizzUnavailable")+"</td></tr></table>";
		}
		displayQuestions.add(r);
		displayQuestions.add(s);
	} catch (Exception e){
		throw new QuizzException ("quizzQuestionNew_JSP.displayQuestion",QuizzException.WARNING,"Quizz.EX_CANNOT_DISPLAY_QUESTIONS",e);
	}

  return displayQuestions;
}

String displayQuestion(QuizzSessionController quizzScc, Question question, int i, String m_context, SettingBundle settings, GraphicElementFactory gef, MultiSilverpeasBundle resources) {
  Collection<Answer> answers = question.getAnswers();
  Board board = gef.getBoard();
  String r = "";
  r += "<br>";
  r += board.printBefore();
  r += "<table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">";
  r += "<tr><td nowrap>";
  r += "<span class=txtlibform>&nbsp;<b>&#149;</b>&nbsp;"+ WebEncodeHelper.javaStringToHtmlString(question.getLabel())+"&nbsp;</span>";
  r += " - "+question.getNbPointsMax()+" pts</td>";
  r += "<td nowrap align=\"right\">";
  r += "<input type=\"hidden\" name=\"cluePenalty_"+i+"\" value=\"0\">";

  if (question.getClue() != null && !question.getClue().equals(""))
	{
			r += "<a href=\"#\" onClick=\"view_clue("+i+","+question.getFatherId()+","+question.getPK().getId()+","+question.getCluePenalty()+")\">"+resources.getString("QuizzSeeClue")+"</a>";
			r += " (" + resources.getString("QuizzPenalty") + "=" + question.getCluePenalty() + " pts)";
	}
	else
		r += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
  r += "</table>";
  r += board.printAfter();
  r += board.printBefore();
  r += "<table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" >";

  if (question.isOpen()) {
        Iterator<Answer> itA = answers.iterator();
        while (itA.hasNext()) {
            Answer answer = (Answer) itA.next();
            String inputValue = answer.getPK().getId()+","+question.getPK().getId();
            r += "<input type=\"hidden\" name=\"answer_"+i+"\" value=\""+inputValue+"\">";
            r += "<tr><td colspan=\"2\"><textarea name=\"openedAnswer_"+i+"\" cols=\"20\" rows=\"3\"></textarea></td></tr>";
        }
  }
  else
  {
  	String style = question.getStyle();
  	if (style.equals("list"))
  	{
  		// liste d�roulante
       	String selectedStr = "";

          r += "<tr><td><select id=\"answer_"+i+"\" name=\"answer_"+i+"\" >";

          Iterator<Answer> itA = answers.iterator();
        while (itA.hasNext())
        {
        	Answer answer = (Answer) itA.next();
        	String inputValue = answer.getPK().getId()+","+question.getPK().getId();
              r += "<option value=\""+inputValue+"\" "+selectedStr+">"+ WebEncodeHelper.javaStringToHtmlString(answer.getLabel())+"</option>";
        }
        r += "</td></tr>";
  	}
  	else
   	{
        String inputType = "radio";
        if (style.equals("checkbox"))
        	inputType = "checkbox";
          Iterator<Answer> itA = answers.iterator();
          int isOpened = 0;
          while (itA.hasNext())
          {
              Answer answer = (Answer) itA.next();
              r += "<tr><td colspan=\"2\"><table width=\"98%\"><tr>";
              String inputValue = answer.getPK().getId()+","+question.getPK().getId();

              // traitement de l'affichage des images
              if (answer.getImage() == null)
	      {
            	    r += "<td align=\"left\">&nbsp;</td>";
	      }
	      else
	      {
		      	String imageUrl = answer.getImage();
		        String url = "";
		        if (imageUrl.startsWith("/"))
		        {
		        	url = imageUrl+"&Size=266x150";
		        }
		        else
		        {
		        	url = FileServerUtils.getUrl(answer.getPK().getComponentName(), answer.getImage(), answer.getImage(), "image/gif", settings.getString("imagesSubDirectory"));
		        }
		        r += "<td width=\"50%\"><img src=\""+url+"\" align=\"left\"></td>";
	      }
              if (answer.isOpened()) {
                  isOpened = 1;
                  r += "<td align=\"left\" width=\"1%\">";
                  r += "<input type=\""+inputType+"\" name=\"answer_"+i+"\" value=\""+inputValue+"\"></td>";
                  r += "<td align=\"left\">"+WebEncodeHelper.javaStringToHtmlString(answer.getLabel())+"";
                  r += "<input type=\"text\" size=\"20\" name=\"openedAnswer_"+i+"\"></td></tr>";
                  r += "<tr><td colspan=2><br></td></tr></table></td></tr>";
              } else {
                  r += "<td align=\"left\" width=\"1%\">";
                  r += "<input type=\""+inputType+"\" name=\"answer_"+i+"\" value=\""+inputValue+"\"></td>";
                  r += "<td width=\"100%\">"+WebEncodeHelper.javaStringToHtmlString(answer.getLabel())+"</td>";
              }
              r += "</tr></table></td></tr>";
          }
  	}
  }
  r += "</table>";
  r += board.printAfter();
  return r;
}


List<String> displayQuestionResult(QuestionContainerDetail quizz, Question question, int i, String m_context, SettingBundle settings, QuizzSessionController quizzScc, boolean solutionAllowed, MultiSilverpeasBundle resources) {

  Collection<Answer> answers = question.getAnswers();
  Collection<QuestionResult> questionResults = question.getQuestionResults();
  List<String> displayQuestionResult = new ArrayList<String>();
  String r = "";
  // User answers
  int questionUserScore = 0;
  Iterator<QuestionResult> itB = questionResults.iterator();
  List<String> qrUser = new ArrayList<String>();
  try {
		while (itB.hasNext()) {
			QuestionResult questionResult = (QuestionResult) itB.next();
			questionUserScore += questionResult.getNbPoints();
			if (question.isOpen()) {
				qrUser.add(questionResult.getOpenedAnswer());
			} else {
				qrUser.add(questionResult.getAnswerPK().getId());
			}
		}
		if (question.getNbPointsMax() < questionUserScore) {
			questionUserScore = question.getNbPointsMax();
		} else if (question.getNbPointsMin() > questionUserScore) {
			questionUserScore = question.getNbPointsMin();
		}
		r = "<br><table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr align=center><td><table border=\"0\" cellspacing=\"0\" cellpadding=\"5\" class=\"contourintfdcolor\" width=\"100%\">";
		r += "<tr><td nowrap width=\"41%\"><span class=txtlibform>&nbsp;<b>&#149</b>&nbsp;"+Encode.javaStringToHtmlString(question.getLabel())+"&nbsp;</span></td>";
		r += "<td class=\"quizzscore\" width=25% align=\"center\">"+resources.getString("ScoreLib")+" : "+questionUserScore+"/"+question.getNbPointsMax()+" pts</td>";
		r += "<td align=\"center\" nowrap>";
		r += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
		r += "</td></tr>";
		if (question.isOpen()) {
			Iterator<Answer> itA = answers.iterator();
			while (itA.hasNext()) {
				Answer answer = (Answer) itA.next();
				String inputValue = answer.getPK().getId()+","+question.getPK().getId();
				r += "<input type=\"hidden\" name=\"answer_"+i+"\" value=\""+inputValue+"\">";
				if (solutionAllowed) {
					r += "<tr><td><textarea disabled name=\"openedAnswer_"+i+"\" cols=\"40\" rows=\"3\">"+qrUser.get(0)+"</textarea></td>";
					r += "&nbsp;&nbsp;<td><textarea disabled name=\"openedAnswer_"+i+"\" cols=\"40\" rows=\"3\">"+answer.getLabel()+"</textarea></td></tr>";
				}
				else
					r += "<tr><td colspan=\"2\"><textarea disabled name=\"openedAnswer_"+i+"\" cols=\"40\" rows=\"3\">"+qrUser.get(0)+"</textarea></td></tr>";
			}
		} else {
			String style = question.getStyle();

			// on est dans le cas de l'affichage,
			// alors on pr�sente les listes d�roulante sous forme de bouton radio
			// pour faire apparaitre le choix de l'utilisateur et les commentaires
			String inputType = "radio";
			//if (question.isQCM())
			if (style.equals("checkbox"))
                  inputType = "checkbox";
			Iterator<Answer> itA = answers.iterator();
			int isOpened = 0;
			while (itA.hasNext()) {
				Answer answer = (Answer) itA.next();
				String inputStatus = "";
				r += "<tr><td colspan=\"3\"><table><tr>";
				String inputValue = answer.getPK().getId()+","+question.getPK().getId();

				// traitement de l'affichage des images
                  if (answer.getImage() == null)
			      {
                	  r += "<td width=50>&nbsp;</td>";
			      }
			      else
			      {
				      	String imageUrl = answer.getImage();
				        String url = "";
				        if (imageUrl.startsWith("/"))
				        {
				        	url = imageUrl+"&Size=266x150";
				        }
				        else
				        {
				        	url = FileServerUtils.getUrl(answer.getPK().getComponentName(), answer.getImage(), answer.getImage(), "image/gif", settings.getString("imagesSubDirectory"));
				        }
				        r += "<td><img src=\""+url+"\" align=\"left\"></td>";
			      }

				if (answer.isOpened()) {
					isOpened = 1;
					r += "<td width=\"40px\" align=\"center\"><input disabled type=\""+inputType+"\" name=\"answer_"+i+"\" value=\""+inputValue+"\"></td><td align=\"left\">";
					if (answer.isSolution() && solutionAllowed)
						r += "<b class=textePetitBoldVert>"+WebEncodeHelper.javaStringToHtmlString(answer.getLabel())+"</b>";
					else
						r += WebEncodeHelper.javaStringToHtmlString(answer.getLabel());
					r += "<BR><input disabled type=\"text\" size=\"20\" name=\"openedAnswer_"+i+"\"></td></tr>";
				} else {
					inputStatus = "";
					if (qrUser!=null){
						for (int cpt=0; cpt<qrUser.size(); cpt++){
							if (qrUser.get(cpt).equals(answer.getPK().getId())) {
								inputStatus = "checked";
							}
						}
					}
					r += "<td width=\"40px\" align=\"center\"><input disabled type=\""+inputType+"\" name=\"answer_"+i+"\" value=\""+inputValue+"\" "+inputStatus+"></td><td align=\"left\">";
					if (answer.isSolution() && solutionAllowed)
						r += "<b class=textePetitBoldVert>"+WebEncodeHelper.javaStringToHtmlString(answer.getLabel())+"</b><BR>";
					else
						r += WebEncodeHelper.javaStringToHtmlString(answer.getLabel())+"<BR>";
					r += "</td>";
					if (solutionAllowed){
   						r += "</tr><tr>";
						r += "<td align=\"left\" colspan=\"3\">";
						r += "<b>"+WebEncodeHelper.javaStringToHtmlParagraphe(answer.getComment())+"</b></td>";
					}
				}
				r += "</tr></table></td></tr>";
			}
		}
		r += "</table></td></tr></table>";
	} catch (NumberFormatException e) {
	}
	displayQuestionResult.add(r);
	displayQuestionResult.add(Integer.toString(questionUserScore));
	displayQuestionResult.add(Integer.toString(question.getNbPointsMax()));

	return displayQuestionResult;
}

String displayQuizzHeaderPreview(QuizzSessionController quizzScc, QuestionContainerHeader quizzHeader, MultiSilverpeasBundle resources, GraphicElementFactory gef) {
  Board board = gef.getBoard();
	String title = WebEncodeHelper.javaStringToHtmlString(quizzHeader.getTitle());
  String description = WebEncodeHelper.javaStringToHtmlParagraphe(quizzHeader.getDescription());
  String comment = WebEncodeHelper.javaStringToHtmlParagraphe(quizzHeader.getComment());
  String r = "";
  r += board.printBefore();
  r += "<table border=\"0\" cellspacing=\"3\" cellpadding=\"0\" width=\"98%\">";
  r += "<tr><td>";
  r += "<span class=\"TitreFenetre\">"+title+"</span>";
  r += "<blockquote>";
  r += "<span class=\"sousTitreFenetre\">"+description+"</span>";
  if (comment != null) {
    r += "<br><br><span class=txttitrecol>"+comment+"</span>";
  }
  r += "</blockquote>";
  r += "</td></tr></table>";
  r += board.printAfter();

  return r;
}



String displayQuizzPreview(QuestionContainerDetail quizz, GraphicElementFactory gef, String m_context,QuizzSessionController quizzScc, MultiSilverpeasBundle resources, SettingBundle settings) throws QuizzException {
  String r = "";
  Question question = null;
  try{
		if (quizz != null) {
			QuestionContainerHeader quizzHeader = quizz.getHeader();
			Collection<Question> questions = quizz.getQuestions();

			//Display the quizz header
			r += displayQuizzHeaderPreview(quizzScc, quizzHeader,resources, gef);

			//Display the questions
			r += "<form name=\"quizz\" Action=\"SubmitQuizz\" Method=\"Post\">";
			Iterator<Question> itQ = questions.iterator();
			int i = 1;
			while (itQ.hasNext()) {
				  question = (Question) itQ.next();
				  r += displayQuestionPreview(question, i, m_context, quizzScc,settings, gef, resources);
				  i++;
			}
			r += "</form>";

		} else {
			r += "<table><tr><td>"+resources.getString("QuizzUnavailable")+"</td></tr></table>";
		}
	} catch(Exception e){
		throw new QuizzException ("quizzQuestionNew_JSP.displayQuizzPreview",QuizzException.WARNING,"Quizz.EX_CANNOT_DISPLAY_QUIZZPREVIEW",e);
	}

	return r;
}


String displayQuestionPreview(Question question, int i, String m_context, QuizzSessionController quizzScc,SettingBundle settings, GraphicElementFactory gef, MultiSilverpeasBundle resources) {
        Collection<Answer> answers = question.getAnswers();
        Board board = gef.getBoard();
        String r = "<br>";
        r += board.printBefore();
        r += "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\"><tr><td nowrap><span class=\"txtlibform\">&nbsp;<b>&#149;</b>&nbsp;"+Encode.javaStringToHtmlString(question.getLabel())+"&nbsp;</span>";
        r += " - "+question.getNbPointsMax()+" pts</td>";
        r += "<td align=\"right\" nowrap>";
        if ((question.getClue() != null)&&(!question.getClue().equals("")))
        {
          r += "<a href=\"#\" onClick=\"view_cluePreview('"+i+"')\">"+resources.getString("QuizzSeeClue")+"</a>";
          r += " (" + resources.getString("QuizzPenalty") + "=" + question.getCluePenalty() + " pts)";
        }
        else
          r += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
        r += "</td></tr></table>";
        r += board.printAfter();
        r += board.printBefore();
        r += "<table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" >";

        String style = question.getStyle();
        if (style.equals("list"))
		{
        	r += "<tr><td colspan=\"2\">";
            r += "<select id=\"answers\" name=\"answers\" >";

        	Iterator<Answer> itA = answers.iterator();
        	while (itA.hasNext())
	        {
	            Answer answer = (Answer) itA.next();
	           	r += "<option name=\"answer_"+i+"\" value=\"\">"+WebEncodeHelper.javaStringToHtmlString(answer.getLabel())+"</option>";
	        }

          r += "</select>";
         	r += "</td></tr>";
		}
		else
		{
	        String inputType = "radio";
	        if (style.equals("checkbox"))
	        	inputType = "checkbox";
	        Iterator<Answer> itA = answers.iterator();
	        while (itA.hasNext())
	        {
	            Answer answer = (Answer) itA.next();
	            r += "<tr><td colspan=\"2\"><table width=\"98%\"><tr>";

	            // traitement de l'affichage des images
	            if (answer.getImage() == null)
			      {
	            	r += "<td align=\"left\">&nbsp;</td>";
			      }
			      else
			      {
				      	String imageUrl = answer.getImage();
				        String url = "";
				        if (imageUrl.startsWith("/"))
				        {
				        	url = imageUrl+"&Size=266x150";
				        }
				        else
				        {
				        	url = FileServerUtils.getUrl(quizzScc.getComponentId(), answer.getImage(), answer.getImage(), "image/gif", settings.getString("imagesSubDirectory"));
				        }
				        r += "<td width=\"50%\"><img src=\""+url+"\" align=\"left\"></td>";
			      }
	            r += "<td width=\"40px\" align=\"center\"><input type=\""+inputType+"\" name=\"answer_"+i+"\"></td><td align=\"left\" width=\"100%\">"+Encode.javaStringToHtmlString(answer.getLabel())+"<BR>";
	            r += "</tr></table>";
            r += "</td></tr>";
	        }
		}
  r += "</table>";
        r += board.printAfter();
        return r;
}

String displayQuizzResult(QuestionContainerDetail quizz, GraphicElementFactory gef, String m_context,QuizzSessionController quizzScc, MultiSilverpeasBundle resources, SettingBundle settings, int nb_user_votes) throws QuizzException {
        String r = "";
        List<String> function = null;
        int quizzUserScore = 0;
        int quizzScoreMax = 0;

        Question question = null;
        Collection answers = null;
        try{
			if (quizz != null) {
				QuestionContainerHeader quizzHeader = quizz.getHeader();
				//Display the quizz header
				r += displayQuizzHeader(quizzScc, quizzHeader, resources, gef);

				boolean solutionAllowed = false;
				if (nb_user_votes >= quizzHeader.getNbParticipationsBeforeSolution())
				  solutionAllowed = true;

				Collection<Question> questions = quizz.getQuestions();
				//Display the quizz header
				String quizzId = quizzHeader.getPK().getId();
				String title = quizzHeader.getTitle();

				//Display the questions
				r += "<form name=\"quizz\" Action=\"quizzQuestionsNew.jsp\" Method=\"Post\">";
				r += "<input type=\"hidden\" name=\"Action\">";
				r += "<input type=\"hidden\" name=\"QuizzId\" value=\""+quizzHeader.getPK().getId()+"\">";
				Iterator<Question> itQ = questions.iterator();
				int i = 1;
				while (itQ.hasNext()) {
					  question = (Question) itQ.next();
					  function = displayQuestionResult(quizz, question, i, m_context, settings, quizzScc, solutionAllowed, resources);
					  r += function.get(0);
					  quizzUserScore += new Integer((String) function.get(1)).intValue();
					  quizzScoreMax += new Integer((String) function.get(2)).intValue();
					  i++;
				}

				//Score total:
				float winRate=((new Float(quizzUserScore).floatValue())/(new Float(quizzScoreMax).floatValue()))*100;
				String winRateImg="tableProf_4.gif";
				String winRate1 = settings.getString("winRate1");
				String winRate2 = settings.getString("winRate2");
				String winRate3 = settings.getString("winRate3");
				String winRate4 = settings.getString("winRate4");
				String winRateImg1 = settings.getString("winRateImg1");
				String winRateImg2 = settings.getString("winRateImg2");
				String winRateImg3 = settings.getString("winRateImg3");
				String winRateImg4 = settings.getString("winRateImg4");

				if (winRate<=new Integer(winRate1).intValue()) {
				  winRateImg=winRateImg1;
				} else if (winRate<=new Integer(winRate2).intValue()) {
				  winRateImg=winRateImg2;
			  } else if (winRate<=new Integer(winRate3).intValue()) {
			    winRateImg=winRateImg3;
        } else if (winRate<=new Integer(winRate4).intValue()) {
          winRateImg=winRateImg4;
        }

				r += "<table width=100% border=0 cellspacing=0 cellpadding=5><tr><td width=50% align=right valign=top class=\"txtnav\">"+resources.getString("TotalScoreLib")+" :</td>";
				r += "<td width=\"50%\"><table border=0 cellspacing=0 cellpadding=0><tr>";
				r += "<td rowspan=3><img src=\"icons/tableProf_1.gif\" width=7 height=70></td><td><img src=\"icons/tableProf_2.gif\" width=34 height=6></td>";
				r += "<td rowspan=3><img src=\"icons/"+winRateImg+"\" width=79 height=70></td></tr>";
				r += "<tr><td height=42 bgcolor=#387B80><span class=\"titreFenetre2\">"+quizzUserScore+"<br><img src=\"icons/1pxBlanc.gif\" width=30 height=1><br>"+quizzScoreMax+"</span></td></tr>";
				r += "<tr><td><img src=\"icons/tableProf_3.gif\" width=34 height=22></td></tr></table></td></tr></table><br>";
			} else {
		        r += "<table><tr><td>"+resources.getString("QuizzUnavailable")+"</td></tr>";
			}
		}catch( Exception e){
			throw new QuizzException ("quizzQuestionNew_JSP.displayQuizzResult",QuizzException.WARNING,"Quizz.EX_CANNOT_DISPLAY_RESULT",e);
		}

		return r;
}

  String displayQuizzResultAdmin(QuestionContainerDetail quizz, GraphicElementFactory gef, String m_context,QuizzSessionController quizzScc, MultiSilverpeasBundle resources, SettingBundle settings) throws QuizzException {
        String r = "";
        List<String> function = null;
        int quizzUserScore = 0;
        int quizzScoreMax = 0;

        Question question = null;
        Collection answers = null;
		try{
			if (quizz != null) {
				QuestionContainerHeader quizzHeader = quizz.getHeader();
				r += displayQuizzHeader(quizzScc,quizzHeader,resources, gef);
				boolean solutionAllowed = true;
				Collection<Question> questions = quizz.getQuestions();
				String quizzId = quizzHeader.getPK().getId();
				String title = quizzHeader.getTitle();
				r += "<form name=\"quizz\">";
				r += "<input type=\"hidden\" name=\"Action\">";
				r += "<input type=\"hidden\" name=\"QuizzId\" value=\""+quizzHeader.getPK().getId()+"\">";
				Iterator<Question> itQ = questions.iterator();
				int i = 1;
				while (itQ.hasNext()) {
					  question = (Question) itQ.next();
					  function = displayQuestionResult(quizz, question, i, m_context, settings, quizzScc, solutionAllowed, resources);
					  r += function.get(0);
					  quizzUserScore += new Integer((String) function.get(1)).intValue();
					  quizzScoreMax += new Integer((String) function.get(2)).intValue();
					  i++;
				}
					float winRate=((new Float(quizzUserScore).floatValue())/(new Float(quizzScoreMax).floatValue()))*100;
				String winRateImg="tableProf_4.gif";
				String winRate1 = settings.getString("winRate1");
				String winRate2 = settings.getString("winRate2");
				String winRate3 = settings.getString("winRate3");
				String winRate4 = settings.getString("winRate4");
				String winRateImg1 = settings.getString("winRateImg1");
				String winRateImg2 = settings.getString("winRateImg2");
				String winRateImg3 = settings.getString("winRateImg3");
				String winRateImg4 = settings.getString("winRateImg4");

				if (winRate<=new Integer(winRate1).intValue())
					winRateImg=winRateImg1;
				else if (winRate<=new Integer(winRate2).intValue())
					winRateImg=winRateImg2;
				else if (winRate<=new Integer(winRate3).intValue())
					winRateImg=winRateImg3;
				else if (winRate<=new Integer(winRate4).intValue())
					winRateImg=winRateImg4;

				r += "<table width=100% border=0 cellspacing=0 cellpadding=5><tr><td width=50% align=right valign=top class=\"txtnav\">"+resources.getString("TotalScoreLib")+" :</td>";
				r += "<td width=\"50%\"><table border=0 cellspacing=0 cellpadding=0><tr>";
				r += "<td rowspan=3><img src=\"icons/tableProf_1.gif\" width=7 height=70></td><td><img src=\"icons/tableProf_2.gif\" width=34 height=6></td>";
				r += "<td rowspan=3><img src=\"icons/"+winRateImg+"\" width=79 height=70></td></tr>";
				r += "<tr><td height=42 bgcolor=#387B80><span class=\"titreFenetre2\">"+quizzUserScore+"<br><img src=\"icons/1pxBlanc.gif\" width=30 height=1><br>"+quizzScoreMax+"</span></td></tr>";
				r += "<tr><td><img src=\"icons/tableProf_3.gif\" width=34 height=22></td></tr></table></td></tr></table><br>";
			} else {
				r += "<table><tr><td>"+resources.getString("QuizzUnavailable")+"</td></tr>";
			}
		} catch(Exception e){
			throw new QuizzException ("quizzQuestionNew_JSP.displayQuizzResultAdmin",QuizzException.WARNING,"Quizz.EX_CANNOT_DISPLAY_RESULT",e);
		}

		return r;
}


  private static final javax.servlet.jsp.JspFactory _jspxFactory =
          javax.servlet.jsp.JspFactory.getDefaultFactory();

  private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;

  static {
    _jspx_dependants = new java.util.HashMap<java.lang.String,java.lang.Long>(7);
    _jspx_dependants.put("jar:file:/home/silverbuild/.m2/repository/org/silverpeas/core/silverpeas-core-web/6.5-build251109/silverpeas-core-web-6.5-build251109.jar!/META-INF/viewGenerator.tld", Long.valueOf(1762717068000L));
    _jspx_dependants.put("jar:file:/home/silverbuild/.m2/repository/org/glassfish/web/javax.servlet.jsp.jstl/1.2.5/javax.servlet.jsp.jstl-1.2.5.jar!/META-INF/fn.tld", Long.valueOf(1531470420000L));
    _jspx_dependants.put("/quizz/jsp/checkQuizz.jsp", Long.valueOf(1708603024712L));
    _jspx_dependants.put("file:/home/silverbuild/.m2/repository/org/glassfish/web/javax.servlet.jsp.jstl/1.2.5/javax.servlet.jsp.jstl-1.2.5.jar", Long.valueOf(1531448975000L));
    _jspx_dependants.put("jar:file:/home/silverbuild/.m2/repository/org/glassfish/web/javax.servlet.jsp.jstl/1.2.5/javax.servlet.jsp.jstl-1.2.5.jar!/META-INF/c.tld", Long.valueOf(1531470420000L));
    _jspx_dependants.put("jar:file:/home/silverbuild/.m2/repository/org/glassfish/web/javax.servlet.jsp.jstl/1.2.5/javax.servlet.jsp.jstl-1.2.5.jar!/META-INF/fmt.tld", Long.valueOf(1531470420000L));
    _jspx_dependants.put("file:/home/silverbuild/.m2/repository/org/silverpeas/core/silverpeas-core-web/6.5-build251109/silverpeas-core-web-6.5-build251109.jar", Long.valueOf(1762717091008L));
  }

  private static final java.util.Set<java.lang.String> _jspx_imports_packages;

  private static final java.util.Set<java.lang.String> _jspx_imports_classes;

  static {
    _jspx_imports_packages = new java.util.LinkedHashSet<>(4);
    _jspx_imports_packages.add("javax.servlet");
    _jspx_imports_packages.add("javax.servlet.http");
    _jspx_imports_packages.add("javax.servlet.jsp");
    _jspx_imports_classes = new java.util.LinkedHashSet<>(68);
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.Encode");
    _jspx_imports_classes.add("org.silverpeas.components.quizz.QuestionForm");
    _jspx_imports_classes.add("java.util.Date");
    _jspx_imports_classes.add("org.silverpeas.core.util.MultiSilverpeasBundle");
    _jspx_imports_classes.add("org.silverpeas.core.persistence.jdbc.DBUtil");
    _jspx_imports_classes.add("org.silverpeas.core.util.URLUtil");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.board.Board");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.window.Window");
    _jspx_imports_classes.add("org.silverpeas.core.admin.user.model.UserDetail");
    _jspx_imports_classes.add("org.silverpeas.kernel.bundle.LocalizationBundle");
    _jspx_imports_classes.add("java.util.Vector");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.tabs.TabbedPane");
    _jspx_imports_classes.add("java.util.Map");
    _jspx_imports_classes.add("org.silverpeas.components.quizz.QuizzException");
    _jspx_imports_classes.add("org.silverpeas.kernel.util.StringUtil");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayCellLink");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.operationpanes.OperationPane");
    _jspx_imports_classes.add("java.util.Collection");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.GraphicElementFactory");
    _jspx_imports_classes.add("org.silverpeas.kernel.bundle.ResourceLocator");
    _jspx_imports_classes.add("org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader");
    _jspx_imports_classes.add("org.silverpeas.core.admin.component.model.ComponentInstLight");
    _jspx_imports_classes.add("java.util.List");
    _jspx_imports_classes.add("org.silverpeas.core.questioncontainer.result.model.QuestionResult");
    _jspx_imports_classes.add("org.silverpeas.core.util.DateUtil");
    _jspx_imports_classes.add("org.silverpeas.core.questioncontainer.answer.model.Answer");
    _jspx_imports_classes.add("org.silverpeas.core.util.WebEncodeHelper");
    _jspx_imports_classes.add("org.silverpeas.core.questioncontainer.question.model.Question");
    _jspx_imports_classes.add("java.util.HashMap");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.iconpanes.IconPane");
    _jspx_imports_classes.add("org.silverpeas.core.questioncontainer.score.model.ScoreDetail");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayLine");
    _jspx_imports_classes.add("java.util.ArrayList");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.buttonpanes.ButtonPane");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayCellText");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayColumn");
    _jspx_imports_classes.add("org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail");
    _jspx_imports_classes.add("org.silverpeas.core.util.file.FileServerUtils");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.buttons.Button");
    _jspx_imports_classes.add("org.silverpeas.core.util.file.FileUploadUtil");
    _jspx_imports_classes.add("java.util.Iterator");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayPane");
    _jspx_imports_classes.add("org.silverpeas.core.util.file.FileRepositoryManager");
    _jspx_imports_classes.add("org.apache.commons.fileupload.FileItem");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.icons.Icon");
    _jspx_imports_classes.add("java.io.IOException");
    _jspx_imports_classes.add("org.silverpeas.kernel.bundle.SettingBundle");
    _jspx_imports_classes.add("org.silverpeas.components.quizz.control.QuizzSessionController");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.frame.Frame");
    _jspx_imports_classes.add("org.silverpeas.components.quizz.QuestionHelper");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.browsebars.BrowseBar");
  }

  private volatile javax.el.ExpressionFactory _el_expressionfactory;
  private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager;

  public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
    return _jspx_dependants;
  }

  public java.util.Set<java.lang.String> getPackageImports() {
    return _jspx_imports_packages;
  }

  public java.util.Set<java.lang.String> getClassImports() {
    return _jspx_imports_classes;
  }

  public javax.el.ExpressionFactory _jsp_getExpressionFactory() {
    if (_el_expressionfactory == null) {
      synchronized (this) {
        if (_el_expressionfactory == null) {
          _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
        }
      }
    }
    return _el_expressionfactory;
  }

  public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() {
    if (_jsp_instancemanager == null) {
      synchronized (this) {
        if (_jsp_instancemanager == null) {
          _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
        }
      }
    }
    return _jsp_instancemanager;
  }

  public void _jspInit() {
  }

  public void _jspDestroy() {
  }

  public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
      throws java.io.IOException, javax.servlet.ServletException {

    if (!javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) {
      final java.lang.String _jspx_method = request.getMethod();
      if ("OPTIONS".equals(_jspx_method)) {
        response.setHeader("Allow","GET, HEAD, POST, OPTIONS");
        return;
      }
      if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method)) {
        response.setHeader("Allow","GET, HEAD, POST, OPTIONS");
        response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET, POST or HEAD. Jasper also permits OPTIONS");
        return;
      }
    }

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html; charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			"../../admin/jsp/errorpage.jsp", true, 16384, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write('\n');
      out.write('\n');
      out.write('\n');

response.setHeader("Cache-Control","no-store"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires",-1); //prevents caching at the proxy server

      out.write('\n');
      out.write('\n');
      org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail quizzUnderConstruction = null;
      synchronized (session) {
        quizzUnderConstruction = (org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail) _jspx_page_context.getAttribute("quizzUnderConstruction", javax.servlet.jsp.PageContext.SESSION_SCOPE);
        if (quizzUnderConstruction == null){
          quizzUnderConstruction = new org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail();
          _jspx_page_context.setAttribute("quizzUnderConstruction", quizzUnderConstruction, javax.servlet.jsp.PageContext.SESSION_SCOPE);
        }
      }
      out.write('\n');
      java.util.ArrayList questionsVector = null;
      synchronized (session) {
        questionsVector = (java.util.ArrayList) _jspx_page_context.getAttribute("questionsVector", javax.servlet.jsp.PageContext.SESSION_SCOPE);
        if (questionsVector == null){
          questionsVector = new java.util.ArrayList();
          _jspx_page_context.setAttribute("questionsVector", questionsVector, javax.servlet.jsp.PageContext.SESSION_SCOPE);
        }
      }
      out.write('\n');
      java.util.HashMap questionsResponses = null;
      synchronized (session) {
        questionsResponses = (java.util.HashMap) _jspx_page_context.getAttribute("questionsResponses", javax.servlet.jsp.PageContext.SESSION_SCOPE);
        if (questionsResponses == null){
          questionsResponses = new java.util.HashMap();
          _jspx_page_context.setAttribute("questionsResponses", questionsResponses, javax.servlet.jsp.PageContext.SESSION_SCOPE);
        }
      }
      out.write('\n');
      out.write('\n');
      out.write("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");

  GraphicElementFactory gef =
      (GraphicElementFactory) session.getAttribute("SessionGraphicElementFactory");
  QuizzSessionController quizzScc = (QuizzSessionController) request.getAttribute("quizz");
  MultiSilverpeasBundle resources = (MultiSilverpeasBundle) request.getAttribute("resources");
  if (quizzScc == null) {
    String sessionTimeout =
        ResourceLocator.getGeneralSettingBundle().getString("sessionTimeout");
    getServletConfig().getServletContext().getRequestDispatcher(sessionTimeout).forward(
        request, response);
    return;
  }
  LocalizationBundle surveyResource = ResourceLocator
      .getLocalizationBundle("org.silverpeas.survey.multilang.surveyBundle",
          quizzScc.getLanguage());

      out.write("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");

String    profile     = (String) request.getAttribute("Profile");

String m_context = ResourceLocator.getGeneralSettingBundle().getString("ApplicationURL");

String exportSrc = m_context + "/util/icons/export.gif";
String copySrc = m_context + "util/icons/copy.gif";

      out.write('\n');
      out.write('\n');
      out.write('\n');
      out.write('\n');


//Retrieve parameter
String action = request.getParameter("Action");
String quizzId = request.getParameter("QuizzId");
String userId = request.getParameter("UserId");
String roundId = request.getParameter("RoundId");
String origin = request.getParameter("Page");
if (origin==null) origin="";
int participationId = 0;

if (roundId == null) {
  roundId = "1";
}

SettingBundle settings = quizzScc.getSettings();

//Html
List<String> html_string = null;

QuestionContainerDetail quizz = null;

if (action.equals("PreviewQuizz")) {
      quizz = (QuestionContainerDetail) session.getAttribute("quizzUnderConstruction");
}
else {
	if (quizzId != null && quizzId.length() != 0) {
		quizz = quizzScc.getQuizzDetail(quizzId);
		session.setAttribute("currentQuizz", quizz);
	}
	else
	{
      quizz = (QuestionContainerDetail) session.getAttribute("currentQuizz");
      if (quizz == null) {
          quizz = quizzScc.getQuizzDetail(quizzId);
          session.setAttribute("currentQuizz", quizz);
          roundId = "1";
      }
	}

  boolean endDateReached = false;
  if (quizz.getHeader().getEndDate() != null) {
          endDateReached = (quizz.getHeader().getEndDate().compareTo(resources.getDBDate(new Date())) < 0);
  }
  if (action == null) {
          action = "ViewQuizz";
  }
}

      out.write("\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n  <title></title>\n");
      if (_jspx_meth_view_005flooknfeel_005f0(_jspx_page_context))
        return;
      out.write("\n<style type=\"text/css\">\n.thumbnailPreviewAndActions {\n  display: none;\n}\n</style>\n<script type=\"text/javascript\">\n<!--\nfunction confirmCancel()\n{\n  jQuery.popup.confirm('");
      out.print(resources.getString("ConfirmCancel"));
      out.write("', function() {\n    self.location = \"Main.jsp\";\n  });\n}\n\nfunction update_suggestion(quizz_id)\n{\n    errorMsg=\"\";\n   document.quizz.Action.value=\"UpdateSuggestion\";\n   if (!isWhitespace(document.quizz.txa_suggestion.value)) {\n      if (!isValidTextArea(document.quizz.txa_suggestion)) {\n            errorMsg = \"");
      out.print(resources.getString("GML.ThisFormContains"));
      out.write(' ');
      out.write('1');
      out.write(' ');
      out.print(resources.getString("GML.error"));
      out.write(" : \\n\";\n            errorMsg += \"  - ");
      out.print(resources.getString("GML.theField"));
      out.write(' ');
      out.write('\'');
      out.print(resources.getString("EducationSuggestion"));
      out.write('\'');
      out.write(' ');
      out.print(resources.getString("MustContainsLessCar"));
      out.write(' ');
      out.print(DBUtil.getTextAreaLength());
      out.write(' ');
      out.print(resources.getString("Caracters"));
      out.write("\\n\";\n            jQuery.popup.error(errorMsg);\n            return;\n      }\n      else\n           document.quizz.submit();\n   }\n   document.quizz.submit();\n}\nfunction view_cluePreview(question_id)\n{\n  largeur = \"600\";\n  hauteur = \"230\";\n\n  SP_openWindow('quizzCluePreview.jsp?question_id='+question_id,'indice',largeur,hauteur,'scrollbars=yes,resizable=yes');\n}\n\nfunction view_clue(i, quizz_id, question_id, cluePenalty)\n{\n  objet = eval(\"document.quizz.cluePenalty_\"+i);\n  if (objet.value == 0)\n    objet.value = cluePenalty;\n  largeur = \"600\";\n  hauteur = \"230\";\n\n SP_openWindow('quizzClue.jsp?quizz_id='+quizz_id+'&question_id='+question_id,'indice',largeur,hauteur,'scrollbars=yes,resizable=yes');\n}\n\n// PopUp center\nfunction SP_openWindow(page,nom,largeur,hauteur,options) {\nvar top=(screen.height-hauteur)/2;\nvar left=(screen.width-largeur)/2;\n	if (window.fenetre != null){\n  	window.fenetre.close();}\nfenetre=window.open(page,nom,\"top=\"+top+\",left=\"+left+\",width=\"+largeur+\",height=\"+hauteur+\",\"+options);\nreturn fenetre;\n");
      out.write("}\n\nfunction MM_openBrWindow(theURL,winName,features) { //v2.0\n  window.open(theURL,winName,features);\n}\n\nfunction sendVote(roundId) {\n  if (roundId == \"end\") {\n    document.quizz.Action.value = \"SendVote\";\n  } else {\n    document.quizz.RoundId.value = roundId;\n    document.quizz.Action.value = \"RecordQuestionsResponses\";\n  }\n  $.progressMessage();\n  document.quizz.submit();\n}\n\nvar exportWindow = window;\n\nfunction Export(url) {\n  sp.preparedDownloadRequest(url).download();\n}\n\nfunction clipboardCopy(id) {\n  top.IdleFrame.location.href = '../..");
      out.print(quizzScc.getComponentUrl());
      out.write("copy?Id='+id;\n}\n\n//-->\n</script>\n</head>\n");


if (action.equals("RecordQuestionsResponses")) {
  int nbQuestions = Integer.parseInt(request.getParameter("NbQuestions"));
  int cluePenalty  = 0;
  Map hash = (Map) session.getAttribute("questionsResponses");
  if (hash == null)
        hash = new HashMap();

  for (int i = 1; i <= nbQuestions; i++) {
      List v = new ArrayList(5);
      cluePenalty = Integer.parseInt(request.getParameter("cluePenalty_"+i));
      v.add("PC"+cluePenalty);
      String[] selectedAnswers = (String[]) request.getParameterValues("answer_"+i);
      if (selectedAnswers != null) {
        String questionId = selectedAnswers[0].substring(selectedAnswers[0].indexOf(",")+1, selectedAnswers[0].length());
        for (int j = 0; j < selectedAnswers.length; j++) {
              String answerId = selectedAnswers[j].substring(0, selectedAnswers[j].indexOf(","));
              v.add(answerId);
        }
        String openedAnswer = request.getParameter("openedAnswer_"+i);
        v.add("OA"+openedAnswer);
        //if (hash.containsKey(questionId))
        hash.put(questionId, v);
      }
  }
  session.setAttribute("questionsResponses", hash);
  action = "ViewCurrentQuestions";
} else if (action.equals("SendVote")) {
  int nbQuestions = Integer.parseInt(request.getParameter("NbQuestions"));
  int cluePenalty  = 0;
  Map hash = (Map) session.getAttribute("questionsResponses");
  if (hash == null)
      hash = new HashMap();

  for (int i = 1; i <= nbQuestions; i++) {
      List v = new ArrayList(5);
      cluePenalty = Integer.parseInt(request.getParameter("cluePenalty_"+i));
      v.add("PC"+cluePenalty);
      String[] selectedAnswers = (String[]) request.getParameterValues("answer_"+i);
      if (selectedAnswers != null) {
        String questionId = selectedAnswers[0].substring(selectedAnswers[0].indexOf(",")+1, selectedAnswers[0].length());
        for (int j = 0; j < selectedAnswers.length; j++) {
              String answerId = selectedAnswers[j].substring(0, selectedAnswers[j].indexOf(","));
              v.add(answerId);
        }
        String openedAnswer = request.getParameter("openedAnswer_"+i);
        v.add("OA"+openedAnswer);
        hash.put(questionId, v);
     }
  }
  quizzScc.recordReply(quizzId, hash);
  action = "ViewResult";
} //End if action = ViewResult

if (action.equals("PreviewQuizz")) {
    out.println("<body>");

    Window window = gef.getWindow();
    BrowseBar browseBar = window.getBrowseBar();
    browseBar.setDomainName(quizzScc.getSpaceLabel());
    browseBar.setComponentName(quizzScc.getComponentLabel());
    browseBar.setExtraInformation(resources.getString("quizz.preview"));

    out.println(window.printBefore());
    Frame frame = gef.getFrame();
    out.println(frame.printBefore());
    String quizzPart = displayQuizzPreview(quizz, gef, m_context, quizzScc, resources, settings);
    out.println(quizzPart);
    out.println(frame.printMiddle());
    out.println("<table width=\"100%\">");
    Button cancelButton = (Button) gef.getFormButton(resources.getString("GML.cancel"), "javascript:confirmCancel();", false);
    Button voteButton = (Button) gef.getFormButton(resources.getString("GML.validate"), "javascript:onClick=document.quizz.submit();", false);
    out.println("<tr><td align=\"center\"><table><tr align=center><td align=center>"+voteButton.print()+"</td><td align=center>"+cancelButton.print()+"</td></tr></table></td></tr>");
    out.println("</table>");
    out.println("<br><br>"+frame.printAfter());
    out.println(window.printAfter());
}
if (action.equals("ViewQuizz")) {
  out.println("<body>");
  Window window = gef.getWindow();
  BrowseBar browseBar = window.getBrowseBar();
  browseBar.setDomainName(quizzScc.getSpaceLabel());
  browseBar.setComponentName(quizzScc.getComponentLabel());
  browseBar.setPath("<a href=\"Main.jsp\">"+resources.getString("QuizzList")+"</a>");
  browseBar.setExtraInformation(quizz.getHeader().getTitle());

  //operation pane
  OperationPane operationPane = window.getOperationPane();
  operationPane.addOperation(m_context + "/util/icons/quizz_print.gif",resources.getString("GML.print"),"javascript:window.print()");
  if (quizzScc.getNbVoters(quizz.getHeader().getPK().getId())==0||"admin".equals(quizzScc.getHighestSilverpeasUserRole().getName()))
  {
  	operationPane.addLine();
	  operationPane.addOperation(m_context + "/util/icons/quizz_to_edit.gif",resources.getString("QuestionUpdate"),"quizzUpdate.jsp?Action=UpdateQuizzHeader&QuizzId="+quizz.getHeader().getPK().getId());
  }

  if (profile.equals("admin")) {
    // export csv
    String url = "ExportCSV?QuizzId=" + quizz.getHeader().getPK().getId();
    operationPane.addOperation(exportSrc, resources.getString("GML.export"), "javaScript:onClick=Export('"+url+"')");
  }

  // copier
  operationPane.addOperation(copySrc, resources.getString("GML.copy"), "javaScript:onClick=clipboardCopy('"+quizz.getHeader().getPK().getId()+"')");

  out.println(window.printBefore());
  Frame frame = gef.getFrame();
  out.println(frame.printBefore());
  String quizzPart = displayQuizz(quizz,gef, m_context, quizzScc, resources, settings, out);
  out.println(quizzPart);

      out.write('\n');
      out.write(' ');
      out.write(' ');
      //  view:pdcClassification
      org.silverpeas.core.web.util.viewgenerator.html.pdc.PdcClassificationTag _jspx_th_view_005fpdcClassification_005f0 = new org.silverpeas.core.web.util.viewgenerator.html.pdc.PdcClassificationTag();
      _jsp_getInstanceManager().newInstance(_jspx_th_view_005fpdcClassification_005f0);
      try {
        _jspx_th_view_005fpdcClassification_005f0.setJspContext(_jspx_page_context);
        // /quizz/jsp/quizzQuestionsNew.jsp(952,2) name = componentId type = java.lang.String reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
        _jspx_th_view_005fpdcClassification_005f0.setComponentId( quizzScc.getComponentId() );
        // /quizz/jsp/quizzQuestionsNew.jsp(952,2) name = contentId type = java.lang.String reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
        _jspx_th_view_005fpdcClassification_005f0.setContentId( quizzId );
        _jspx_th_view_005fpdcClassification_005f0.doTag();
      } finally {
        _jsp_getInstanceManager().destroyInstance(_jspx_th_view_005fpdcClassification_005f0);
      }
      out.write('\n');

  out.println(frame.printMiddle());
  out.println(frame.printAfter());
  out.println(window.printAfter());
} //End if action = ViewQuizz
else if (action.equals("ViewCurrentQuestions")) {
  out.println("<body>");

  Window window = gef.getWindow();
  BrowseBar browseBar = window.getBrowseBar();
  browseBar.setDomainName(quizzScc.getSpaceLabel());
  browseBar.setComponentName(quizzScc.getComponentLabel());
  browseBar.setPath("<a href=\"Main.jsp\">" + resources.getString("QuizzList") + "</a>");
  browseBar.setExtraInformation(resources.getString("QuizzParticipate") + " " + quizz.getHeader().getTitle());

  //operation pane
  OperationPane operationPane = window.getOperationPane();
  operationPane.addOperation(m_context + "/util/icons/quizz_print.gif",resources.getString("GML.print"),"javascript:window.print()");

  out.println(window.printBefore());
  Frame frame = gef.getFrame();
  out.println(frame.printBefore());

  html_string = displayQuestions(quizz, Integer.parseInt(roundId), gef, m_context, quizzScc, resources, settings, frame, out);
  out.println(html_string.get(0));
  out.println(frame.printMiddle());
  out.println(html_string.get(1));
  out.println(frame.printAfter());
  out.println(window.printAfter());
}
else if (action.equals("ViewResult")) {
  out.println("<body>");
  String participation = request.getParameter("ParticipationId");
  int nb_user_votes = 0;
  Collection<ScoreDetail> userScores = quizzScc.getUserScoresByFatherId(quizzId);
  if (userScores != null) {
    nb_user_votes = userScores.size();
  }

  if (StringUtil.isDefined(participation)) {
    participationId = Integer.parseInt(participation);
  } else {
	  participationId=nb_user_votes;
  }

  if (userId == null) {
    quizz = quizzScc.getQuestionContainerForCurrentUserByParticipationId(quizzId, participationId);
  } else {
    quizz = quizzScc.getQuestionContainerByParticipationId(quizzId, userId, participationId);
  }

  Window window = gef.getWindow();
  BrowseBar browseBar = window.getBrowseBar();
  browseBar.setDomainName(quizzScc.getSpaceLabel());
  browseBar.setComponentName(quizzScc.getComponentLabel());
  browseBar.setPath("<a href=\"Main.jsp\">"+resources.getString("QuizzList")+"</a>");
  browseBar.setExtraInformation(resources.getString("QuizzSeeResults"));

  //operation pane
  OperationPane operationPane = window.getOperationPane();
  operationPane.addOperation(m_context + "/util/icons/quizz_print.gif",resources.getString("GML.print"),"javascript:window.print()");

  out.println(window.printBefore());
  Frame frame = gef.getFrame();
  out.println(frame.printBefore());
  String quizzPart = displayQuizzResult(quizz, gef, m_context, quizzScc, resources, settings, nb_user_votes);
  ScoreDetail userScoreDetail = null;
  //Suggestion pedagogique
  if (userId == null) {
    userScoreDetail= quizzScc.getCurrentUserScoreByFatherIdAndParticipationId(quizzId, participationId);
  } else
    userScoreDetail= quizzScc.getUserScoreByFatherIdAndParticipationId(quizzId, userId, participationId);

  if ((userScoreDetail.getSuggestion()!=null) && (!userScoreDetail.getSuggestion().equals(""))) {
    quizzPart += "<table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr align=center><td><table border=\"0\" cellspacing=\"0\" cellpadding=\"5\" class=\"contourintfdcolor\" width=\"100%\"><tr><td valign=\"top\"><img src=\"icons/silverProf_SuggPedago.gif\" align=\"left\"><span class=\"txtnav\">";
    quizzPart += resources.getString("EducationSuggestion") + " :</span><br>";
    quizzPart += WebEncodeHelper.javaStringToHtmlString(userScoreDetail.getSuggestion())+"</td></tr></table></td></tr></table>";
  }

  out.println(quizzPart);
  out.println(frame.printMiddle());

  Button cancelButton = gef.getFormButton(resources.getString("GML.back"), "Main.jsp", false);
  if (origin.equals("1")) {
    cancelButton = gef.getFormButton(resources.getString("GML.cancel"), "quizzResultUser.jsp", false);
  } else if (origin.equals("0")) {
    cancelButton = gef.getFormButton(resources.getString("GML.cancel"), "palmares.jsp?quizz_id="+quizzId, false);
  }
  out.println("<table width=100% border=\"0\">");
  out.println("<tr><td align=\"center\">"+cancelButton.print()+"</td></tr>");
  out.println("</table>");
  out.println(frame.printAfter());
  out.println(window.printAfter());
}
else if (action.equals("ViewResultAdmin")) {
  out.println("<body>");
  participationId = Integer.parseInt(request.getParameter("ParticipationId"));
  quizz = quizzScc.getQuestionContainerByParticipationId(quizzId, userId, participationId);

  Window window = gef.getWindow();
  BrowseBar browseBar = window.getBrowseBar();
  browseBar.setDomainName(quizzScc.getSpaceLabel());
  browseBar.setComponentName(quizzScc.getComponentLabel());
  browseBar.setPath("<a href=\"Main.jsp\">"+resources.getString("QuizzList")+"</a>");
  browseBar.setExtraInformation(resources.getString("QuizzSeeResults"));

  //operation pane
  OperationPane operationPane = window.getOperationPane();
  operationPane.addOperation(m_context + "/util/icons/quizz_print.gif",resources.getString("GML.print"),"javascript:window.print()");

  out.println(window.printBefore());
  Frame frame = gef.getFrame();
  out.println(frame.printBefore());
  String quizzPart = displayQuizzResultAdmin(quizz, gef, m_context, quizzScc, resources, settings);
  //Suggestion pedagogique
  ScoreDetail userScoreDetail= quizzScc.getUserScoreByFatherIdAndParticipationId(quizzId, userId, participationId);

  quizzPart += "<table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr align=center><td><table border=\"0\" cellspacing=\"0\" cellpadding=\"5\" class=\"contourintfdcolor\" width=\"100%\"><tr><td valign=\"top\"><img src=\"icons/silverProf_SuggPedago.gif\" align=\"left\"><span class=\"txtnav\">";
  quizzPart += resources.getString("EducationSuggestion") + " :</span><br>";
  quizzPart += "<textarea name=\"txa_suggestion\" cols=\"120\" rows=\"4\">";
  if (userScoreDetail.getSuggestion()!=null) {
    quizzPart += userScoreDetail.getSuggestion();
  }
  quizzPart += "</textarea>";
  quizzPart += "</td></tr></table></td></tr></table>";
  quizzPart += "<input type=\"hidden\" name=\"UserId\" value=\""+userId+"\">";
  quizzPart += "<input type=\"hidden\" name=\"ParticipationId\" value=\""+participationId+"\">";
  quizzPart += "<input type=\"hidden\" name=\"Page\" value=\""+origin+"\">";

  out.println(quizzPart);
  out.println(frame.printMiddle());
  Button cancelButton= gef.getFormButton(resources.getString("GML.back"), "quizzAdmin.jsp", false);
  if (origin.equals("1")) {
    cancelButton = gef.getFormButton(resources.getString("GML.cancel"), "quizzResultAdmin.jsp", false);
  } else if (origin.equals("0")) {
    cancelButton = gef.getFormButton(resources.getString("GML.cancel"), "palmaresAdmin.jsp?quizz_id="+quizzId, false);
  }
  Button voteButton = gef.getFormButton(resources.getString("QuestionUpdate"), "javascript:update_suggestion("+quizz.getHeader().getPK().getId()+")", false);
  out.println("<table width=100% border=\"0\">");
  out.println("<tr><td align=\"center\"><table><tr><td align=center>"+voteButton.print()+"</td><td align=center>"+cancelButton.print()+"</td></tr></table></td></tr>");
  out.println("</table>");
  out.println(frame.printAfter());
  out.println(window.printAfter());
}
else if (action.equals("UpdateSuggestion")) {
  String suggestion = request.getParameter("txa_suggestion");
  participationId = Integer.parseInt(request.getParameter("ParticipationId"));
  //Suggestion pedagogique
  ScoreDetail userScoreDetail = quizzScc.getUserScoreByFatherIdAndParticipationId(quizzId, userId, participationId);
  userScoreDetail.setSuggestion(suggestion);
  quizzScc.updateScore(userScoreDetail);

  if (origin.equals("0"))
  {

      out.write("\n          <script type=\"text/javascript\">\n          <!--\n          self.location=\"palmaresAdmin.jsp?quizz_id=");
      out.print(quizzId);
      out.write("\";\n          //-->\n          </script>\n");

  } else if (origin.equals("1")) {

      out.write("\n<script type=\"text/javascript\">\n<!--\nself.location=\"quizzResultAdmin.jsp\";\n//-->\n</script>\n");

  }
}

      out.write('\n');
      if (_jspx_meth_view_005fprogressMessage_005f0(_jspx_page_context))
        return;
      out.write("\n</body>\n</html>\n");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              out.clearBuffer();
            }
          } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }

  private boolean _jspx_meth_view_005flooknfeel_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
          throws java.lang.Throwable {
    javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
    javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
    //  view:looknfeel
    org.silverpeas.core.web.util.viewgenerator.html.LookAndStyleTag _jspx_th_view_005flooknfeel_005f0 = new org.silverpeas.core.web.util.viewgenerator.html.LookAndStyleTag();
    _jsp_getInstanceManager().newInstance(_jspx_th_view_005flooknfeel_005f0);
    _jspx_th_view_005flooknfeel_005f0.setPageContext(_jspx_page_context);
    _jspx_th_view_005flooknfeel_005f0.setParent(null);
    // /quizz/jsp/quizzQuestionsNew.jsp(753,0) name = withFieldsetStyle type = boolean reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
    _jspx_th_view_005flooknfeel_005f0.setWithFieldsetStyle(true);
    // /quizz/jsp/quizzQuestionsNew.jsp(753,0) name = withCheckFormScript type = boolean reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
    _jspx_th_view_005flooknfeel_005f0.setWithCheckFormScript(true);
    int _jspx_eval_view_005flooknfeel_005f0 = _jspx_th_view_005flooknfeel_005f0.doStartTag();
    if (_jspx_th_view_005flooknfeel_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
      return true;
    }
    org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_view_005flooknfeel_005f0, _jsp_getInstanceManager());
    return false;
  }

  private boolean _jspx_meth_view_005fprogressMessage_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
          throws java.lang.Throwable {
    javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
    javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
    //  view:progressMessage
    org.silverpeas.core.web.util.viewgenerator.html.progressmessage.ProgressMessageTag _jspx_th_view_005fprogressMessage_005f0 = new org.silverpeas.core.web.util.viewgenerator.html.progressmessage.ProgressMessageTag();
    _jsp_getInstanceManager().newInstance(_jspx_th_view_005fprogressMessage_005f0);
    _jspx_th_view_005fprogressMessage_005f0.setPageContext(_jspx_page_context);
    _jspx_th_view_005fprogressMessage_005f0.setParent(null);
    int _jspx_eval_view_005fprogressMessage_005f0 = _jspx_th_view_005fprogressMessage_005f0.doStartTag();
    if (_jspx_th_view_005fprogressMessage_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
      return true;
    }
    org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_view_005fprogressMessage_005f0, _jsp_getInstanceManager());
    return false;
  }
}
