• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Re: text input Denominator division by pressing a button

Explorer ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

How do i make a counter like for a survey to add up points if each one counts as one, do i make two boonlean textinputs to be false next to a text input, and a button.

And say if text input1 = textinput2 that text input eqauls 1.

?

And a final total text input that on the same button is the sum of textinput 3 and if i did the same 3 inanother question that it would be textinput 6....(3+6= 2 or 1 depending if there was a match.

TOPICS
ActionScript

Views

990

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

create a counter/score variable and initialize it to zero

increment it with each correct answer:

var score:Number=0;

if(<..answer is correct>){

score++;

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

currently my button code is this :

find2._visible = true;

find2.onRelease = function(){

answer2.text = Number(input2.text)/2;

}

and ive a new text input now, called score. so far its : score._visible = true;

the code you sent to me is it for the button , how does it know if the answer is correct ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

do you ever check if a user's answer is correct?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

i havent designed it yet , and can quickly put in a "answer thats correct" and boolean it false, so that its in the text input"correct1" and then have an "answer 1" thats filled in, and on a button "go" use "score to total up, and a text input " number1" thats boonleaned false, that on "go" ..

If answer1.text = correct1.text then if so number1.text = 1

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

I know the code isnt right yet but thats my thiughts on such ..can u help me with a right code please.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

use:

if(answer1.text==correct1.text){

score++;

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

i went to go make it, and took your code and applied it and am having difficultly, heres my code im using :

go1._visible = true;

go1.onRelease = function(){

q1STudentAnswerrecieved.text = q1STudentAnswer.text;

q1STudentAnswer.text = q1STudentAnswer.text;

if(q1STudentAnswerrecieved == q1teacherAnswer.text){

score++

}

when i drew it out, i used a text input for the correct teachers answer and did an answer input text box for the student and duplicated the students answer to a text box under the teachers correct answer box, and that worked cool as soon as i added the last bit of code it stopped working for me hense im showing you my code i used, which is slightly different in names ,sorry, please help, thank you.

i made two other text inputs called Q score and score; i was hoping that if the two answers match that Qscore will reflect , right, wrong or the actual mark or points for the question, and that "score is the total of them.

grab.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

grab1.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

grab2.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

grab3.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

? Score ++

.... Could it be qscore++ would it. Do the same

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

i don't understand what you're trying to show.  but

go1._visible = true;

go1.onRelease = function(){

q1STudentAnswerrecieved.text = q1STudentAnswer.text;  // what's the purpose of this?

q1STudentAnswer.text = q1STudentAnswer.text;  // this looks like it does nothing

if(q1STudentAnswerrecieved == q1teacherAnswer.text){  //  q1STudentAnswerrecieved looks like it's a textfield

score++

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

As in my pictures, ive a text field for instructions,the question number, the answer note and the question, and the answer all are text inputs,they are top left grey box, on the right what i write in on the left box appears on the right box except the answer, when i press go on the left, when i press go on the right side the answer only appears in the left box, under the other text inputs , the "inputs called ...recieved are the recieving text input fields, now if teachers answer and students answer are the same it should give a total and im looking for a individual score, q score being the individual score, but im not getting the score and q score functioning yet and also to keep the entered data on the left permanently on the right even if the webpage is refreshed im presuming it will reset, this i have not tried yet and am putting out there imcase theres a code to use that i need to know about, and on the text inputs to make it only alphetical or only numericals

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 15, 2018 Apr 15, 2018

Copy link to clipboard

Copied

the students answer reflect on the teachers question part, from the right were entered to the left where duplicated to, but the score++ doesnt work,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 15, 2018 Apr 15, 2018

Copy link to clipboard

Copied

are a student and a teacher answering those questions at the same time?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 15, 2018 Apr 15, 2018

Copy link to clipboard

Copied

no the answer is put in when the questions are put in,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 15, 2018 Apr 15, 2018

Copy link to clipboard

Copied

i would like to beable to review the question at a later time and view the 1 students answer

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 15, 2018 Apr 15, 2018

Copy link to clipboard

Copied

but when the student has completed the question by answering that the answer reflect to the teachers answer, underneath it almost and then gives a mark for the question, and adds the mark to the total mark.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 15, 2018 Apr 15, 2018

Copy link to clipboard

Copied

ill then reflect the question mark and total mark once test is completed,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 15, 2018 Apr 15, 2018

Copy link to clipboard

Copied

because of your lack of coding experience, you're not going to be able to review anything later unless you're using the same computer the student used.  are you both using the same computer?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 15, 2018 Apr 15, 2018

Copy link to clipboard

Copied

im the teacher to be, and can allow a student to use my pc, and if in this case so, when the swf is played it stores nothing in both the right and left side,  the create text field we looked at much earlier in the week if thats added on and a code is used to select the created text fields to use for the left part, the teachers side perhaps it will be better for me to select the questions out of, and then to use a button to preload the text inputs that i would have used to create the create textfield with, however earlier in the week i did see that everytime the swf played/tested it has no memory of its previous play/test.

and i would like students to be  able to use a computer from anywhere to answer the questions.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 16, 2018 Apr 16, 2018

Copy link to clipboard

Copied

how can a student both "..use my pc.." and "...use a computer from anywhere.."? 

is your pc a laptop that you're lending?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 15, 2018 Apr 15, 2018

Copy link to clipboard

Copied

go._visible = true;

go.onRelease = function(){

instructionsrecieved.text = instructions.text;

instructions.text = instructions.text;

headingrecieved.text = heading.text;

headingrecieved.text = heading.text;

q1recieved.text = q1.text;

q1.text = q1.text;

heading1recieved.text = heading1.text;

heading1.text = heading1.text;

}

is my teacher go button so far,

and this is the students go1 button so far :

go1._visible = true;

go1.onRollOut = function(){

q1STudentAnswerrecieved.text = q1STudentAnswer.text;

q1STudentAnswer.text = q1STudentAnswer.text;

}

go1.onRelease = function(){

if( q1teacherAnswer.text == q1STudentAnswerrecieved.text )

score++

}

i saw on a previous code  i had :

go1.onRelease = function(){

if( q1teacherAnswer.text == q1STudentAnswerrecieved.text ){

score++

}

but changed it to the one on the go1 button but the score ++ doesnt display again, do i need to do something with a border to display, is it similar to the create text field code where it showed when the border was put on ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 16, 2018 Apr 16, 2018

Copy link to clipboard

Copied

No student has used my apple mac pro tower yet, how would it differ if my pc was used to capture the students answer or wether it was done by a internet cafe or from their home ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines