שאלה ב-JAVA

Doctor Evil

New member
שאלה ב-JAVA

יצרתי QUIZ והכל טוב ויפה חוץ מהעובדה שהכפתרוים מופיעים לי בצד שמאל (אחרי התשובה בעברית) במקום להופיע בצד ימין לפני התשובה. איך מסדרים? תודה.
 

neko

New member
אתה לא ממש מפרט - איך יצרת

את הGUI? בAWT? כתבת לבד או ע"י תוכנה כמו JBUILDER שמסדרת דברים בשבילך? בסה"כ, זו לא צריכה להיות בעיה להצמיד כפתורים לצד זה או אחר.
 

Doctor Evil

New member
JAVA SCRIPT

בסך הכל העתקתי והדבקתי, ובאמצע שיניתי את כל הטקסט שמופיע באנגלית לעברית.
 

Zack DA

New member
עברית עושה צרות ../images/Emo13.gif

אתה מוזמן להעלות את הקוד לכאן...
 

Doctor Evil

New member
הקוד

זה הקוד המקורי, כלומר לפני ששיניתי חלקים לעברית. בסוף איפה שכתוב START לשם נכנסות השאלות של החידון.
// // QueryString // function QueryString(key) { var value = null; for (var i=0;i<QueryString.keys.length;i++) { if (QueryString.keys==key) { value = QueryString.values; break; } } return value; } QueryString.keys = new Array(); QueryString.values = new Array(); function QueryString_Parse() { var query = window.location.search.substring(1); var pairs = query.split("&"); for (var i=0;i<pairs.length;i++) { var pos = pairs.indexOf('='); if (pos >= 0) { var argname = pairs.substring(0,pos); var value = pairs.substring(pos+1); QueryString.keys[QueryString.keys.length] = argname; QueryString.values[QueryString.values.length] = value; } } } QueryString_Parse(); // // Answer // function Answer_WriteHTML() { document.write('<INPUT type="radio" value="' + this.id + '" name="answers"> '); document.write('<span class="quizText">' + this.text + '</span><br>'); } function Answer(aID) { this.text = "New Answer"; this.id = aID; this.correct = false; this.WriteHTML = Answer_WriteHTML; } // // AnswerList // function AnswerList_NewAnswer() { var a = new Answer(this.sequenceID); this.sequenceID++; this.aList[this.aList.length] = a; // Optional Args: text, correct if (arguments.length > 0) a.text = arguments[0]; if (arguments.length > 1) a.correct = arguments[1]; if (this.editor) this.editor.AnswerSectionUpdate(); return a; } function AnswerList_Remove(id) { for (var i=0;i<this.aList.length;i++) { if (this.aList && this.aList.id == id) { this.aList = null; break; } } } function AnswerList_Find(id) { var result = null; for (var i=0;i<this.aList.length;i++) { if (this.aList && this.aList.id == id) { result = this.aList; break; } } return result; } function AnswerList_WriteHTML() { for (var i=0;i<this.aList.length;i++) this.aList.WriteHTML(); } function AnswerList(editor) { this.editor = editor; this.sequenceID = 0; this.aList = new Array(); this.NewAnswer = AnswerList_NewAnswer; this.Remove = AnswerList_Remove; this.Find = AnswerList_Find; this.WriteHTML = AnswerList_WriteHTML; } // // Question // function Question_NewAnswer(text,correct) { this.answerList.NewAnswer(text,correct); } function Question_WriteHTML() { document.write('<p class="quizQuestion">Q: ' + this.text + '</p>'); this.answerList.WriteHTML(); } function Question_GetCorrectAnswer(text,correct) { var result = ""; for (var i=0;i<this.answerList.aList.length;i++) { if (this.answerList.aList && this.answerList.aList.correct) { result = this.answerList.aList.text; break; } } return result; } function Question(qID,editor) { this.text = "New Question"; this.id = qID; this.editor = editor; this.answerList = new AnswerList(editor); this.NewAnswer = Question_NewAnswer; this.WriteHTML = Question_WriteHTML; this.GetCorrectAnswer = Question_GetCorrectAnswer; } // // QuestionList // function QuestionList_NewQuestion() { var q = new Question(this.sequenceID,this.editor); this.sequenceID++; this.qList[this.qList.length] = q; // Optional Args: text if (arguments.length > 0) q.text = arguments[0]; if (this.editor) this.editor.QuestionItemsAdd(q); return q; } function QuestionList_Remove(id) { for (var i=0;i<this.qList.length;i++) { if (this.qList && this.qList.id == id) { &nbsp
 

Doctor Evil

New member
המשך הקוד

} if (index < this.qList.length) { document.write('<input type="hidden" name="lastQuestion" value="' + index + '">') this.qList[index].WriteHTML(); document.write('<p><input type="submit" name="submit" value="Next Question >>"></p>') } else { var score = Math.round((ccount*100)/this.qList.length); var scoreResults = this.ScoreResults(Math.min(Math.floor(score/10),9)); document.write('<p class="quizText">You answered ' + ccount + ' items out of ' + this.qList.length + ' correctly.</p>'); document.write('<p class="quizText">Your score is ' + score + '%. ' + scoreResults + '</p>'); } document.write('<input type="hidden" name="ccount" value="' + ccount + '">') document.write('</form>'); } function QuestionList_ScoreResults(index,text) { // Optional Args: text if (arguments.length > 1) { this.scoreResults[index] = text; } return this.scoreResults[index]; } function QuestionList(editor) { this.sequenceID = 0; this.qList = new Array(); this.scoreResults = new Array(10); this.editor = editor; this.NewQuestion = QuestionList_NewQuestion; this.Remove = QuestionList_Remove; this.Find = QuestionList_Find; this.WriteHTML = QuestionList_WriteHTML; this.ScoreResults = QuestionList_ScoreResults; } function QuestionListValidate(theForm) { var validated = false; for (var i=0;i<theForm.answers.length;i++) { if (theForm.answers.checked == true) { validated = true; break; } } if (!validated) alert("Please select an answer before continuing."); return validated; } var gQuestionList = new QuestionList(null); // Quiz Source Start (to edit with QuizEditor copy/paste between here and end // --> // <-- Quiz Source End
 
למעלה