search for: question

Displaying 20 results from an estimated 105629 matches for "question".

2006 Apr 26
7
Not updating
I copied the scaffolding edit and update and made it like this, Note: awnser is edit. Admin_contoller.rb def awnser @question = Question.find(params[:id]) end def update @question = Question.find(params[:id]) if @question.update_attributes(params[:question]) flash[:notice] = ''Question was successfully updated.'' redirect_to :action => ''list'' else render :action =&gt...
2007 Nov 10
2
Problem with view spec - works inside the browser but spec fails with nil object
...about this exact same thing. So here it goes, hope someone can help. I''m trying to spec a view which works correctly on the browser, but that generates the following error when I run "rake spec:views". ActionView::TemplateError in ''/survey/show should display the "question 4" heading correctly'' You have a nil object when you didn''t expect it! The error occurred while evaluating nil.position On line #1 of app/views/survey/_question_for_candidate.rhtml 1: <div class="question question-<%= question.position %>"> 2:...
2006 Apr 20
1
Rails is losing key information
I am using ruby 1.8.4 with rails 1.0 under fedora core 3 on a WIntel platform. Rails appears to be losing key information under some circumstances. Specifically, in the Questions class that follows, the presentation_id property is apparently being lost. The STDOUT dump from the create method indicates that the presentation_id should be 42, but the dump from the database shows that it is 43, which is the same as the explanation_presentation_id Any ideas? Is this a known...
2006 Mar 15
7
Populating text_tag with serialized data
I am using a serialized attribute in one of my models The serialized data is in the form of an array. I want to have a text_tag for each element contained in my serialized attribute. How would I construct the text_tag? My model name is ''questions''. The serialized attribute is "answers" So I might have: <% form tag %> <% text_tag ''question'', ''name'' %> <% text_tag ''question'', ''answers[0]'' %> <% text_tag ''question'...
2011 Jul 11
2
Pre-populating association
Hello, I think this is an easy one for the average Rails developer but I''m a bit stuck. I''m creating a simple voting app: any user can create a survey, with any number of questions, and other users can then vote by creating a ballot for that survey. Here''s the modeling: class Survey < ActiveRecord::Base has_many :questions has_many :eligibilities has_many :ballots accepts_nested_attributes_for :questions, :allow_destroy => true attr_accessible...
2006 Jan 19
8
Passing variables across forms
I''ve been reading my Agile Dev book over and over again, but I can''t wrap my head around how to do this. There''s a question and answer portion site of my site. You begin the process by adding a question to the database. After that, the program should redirect you straight to adding an answer for that question. The problem is, I don''t know how to keep track of the answer''s question id. Here'...
2006 Apr 03
15
How should I pick a random entry from the database?
...stuff since 1996 but only began the foray into scripting last year. I haven''t got my skull completely 360 degrees around OOP yet. It''s just me here (in Japan) and there are no Ruby groups in my area (never mind any in English). I''ve got a database table - real simple: question, answer, and id fields - and I want to pick one question out randomly and output to the HTML page. Right now I can''t even get single entries out - all I can do is copy and paste from the scaffolding, so it''s every question or no questions at this point. I''m not sure i...
2006 May 02
10
[OT]: Asking questions on this list
Hi List, it appears that for the third or fourth time now, I''ve asked a question that nobody seems to respond to. Other questions (often things that could quite easily have been extracted by searching with Google or from api.rubyonrails.org) are answered almost momentarily. I''ve to admit I''m more than a little frustrated by this, so have to ask myself if it w...
2005 May 18
2
R -SQL
Hello, I've got a problem in a sql query! for(j in 1:length(criteria$Title)) { graphe_par<-sqlQuery(channel,"select q.type,crit.Title, r.Value from criteria crit, reply r,question_reply qr, question q, question_criteria qc, form_question fq where qr.reply=r.ID and qr.question=q.ID and qc.question=q.ID and crit.ID=qc.criteria and fq.question=q.ID and fq.form=4 and crit.Title=" & criteria$Title[j] &";") ............} > criteria$Title [1] Content...
2012 Oct 06
0
rails 3.2 question/answer with a through table
I have a person has many questions through person_questions. I have an extra column in the join table for the answer. The section below works for a new submit but when I edit I get 3 each with the first 2 of each selected tand the third not so I get 6 check boxes some selected some not. Is there a way to get this to work pr...
2006 Mar 19
2
Functional Testing
Hey all, I have a many-to-many relationship (Questions has_and_belongs_to_many Answers), and when I destroy the Question (the one) I also destroy all the Answers (the many). Since the following doesn''t seem to work for has_and_belongs_to_many: class Question < AR::Base... has_and_belongs_to_many :answers, :dependent => :destroy end...
2006 Apr 23
4
Penalties of using an eval on every request
Hello RoR! I''m building a rails app for hosting multi-page surveys. I set up questionnaire, question, and question_component models. Now I''m initializing them with some data. survey.rb q1 = Question.new "q1" q1.quote "Welcome to a test of the new interviewing system." q2 = Question.new "q2" q2.quote "Do you like pie?" q...
2009 Dec 15
1
R question type in Moodle
Moodle (www.moodle.org) is an open source course management system, a competitor to Blackboard. I am writing several hundred R questions that will be used within the quiz module in Moodle. Unfortunately, Moodle does not have a built in question type for R. You can read about the different questions types in Moodle here: http://moodle.org/mod/data/view.php?d=13&perpage=40&search=Question+Type&sort=0&order=DESC&a...
2006 Apr 01
0
Okay, what gives? find_by_id is failing.
This has the look of a "just don''t quite get it yet" problem. I am using the ActiveRecord.find_by_id method to identify the parent object (Quiz) to tie to the child object (Question) at create time. Here is the stdout log: 127.0.0.1 - - [31/Mar/2006:22:43:22 CST] "GET /question/new? parent_quiz=ff2d7022-be0a-11da-9f01-00400506faf5 HTTP/1.1" 200 806 http://localhost:3000/questions?parent_quiz=ff2d7022- be0a-11da-9f01-00400506faf5 -> /question/new?parent_quiz=ff2d...
2004 Jun 29
2
Numbers as symbols
I want to use question numbers from my survey data (fake data below) as markers in a scatterplot. I'm using "as.character" to convert question numbers to characters. However, plot truncates the 0 (zero) off of question 10. How can I get the ending zero so I can add questions 11 - 20? # Sample code below Q...
2006 Jul 01
4
Radio_button in loop problem
Hi all, I can''t figure out why my radio_buttons won''t reflect the values stored in my database. I read through some of the previous posts -- is it true that they don''t work with integers? This is the code I''m using: <% for question in @survey.questions %> <%= debug question %> <%= radio_button ( "question", :question_id, question.option_one.id) %> <%= question.option_one %> <%= radio_button ( "question", :question_id, question.option_two.id) %> <%= question.optio...
2009 Dec 11
1
Sources for open sourced homework questions for R?
Hi, I am teaching a one month class in applied statistics and want to bring my students up to speed in R without devoting much/any lecture time to R instruction. I think that the best way to do this is to provide them with a lot of R questions for homework. These questions would be numerous (there is a lot of material to cover), go from very simple to somewhat complex, and focus on all the commands and options that will be useful in applied work. Here are some of my initial questions: ------------------------ Q: Load the data from the...
2003 Dec 20
6
draft of posting guide
...I've left out most HTML formatting (except for headings) to make it readable -- I'll insert that later (to conform with the style on the other pages at r-project.org.) I've placed "???" in places where feedback is specifically needed. <h2>Posting Guide: How to ask good questions that prompt useful answers</h2> * Remember that R is free software, constructed and maintained by volunteers. They have various reasons for contributing to R, but often have limited time. Remember that no one owes you anything, and if you rude or disrespectful in your questions, y...
2011 Feb 13
4
A Math question
Dear all, I admit this is not anything to do R and even with Statistics perhaps. Strictly speaking this is a math related question. However I have some reasonable feeling that experts here would come up with some elegant suggestion to my question. Here my question is: What is sum of all Integers? I somewhere heard that it is Zero as positive and negative integers will just cancel each other out. However want to know is it cor...
2006 Apr 02
2
"Quiz" site
Hi, I am thinking about how to best design a quiz site in RoR. I think it should be fairly easy, but have run into a wall. In the simplest form, the view would grab all of the questions for a particular quiz and display them (e.g. multiple choice, so 4 option buttons per question). However, I can''t figure out how to "mark" the quiz. The form is submitted to the controller, which must somehow work out whether each one is correct. Perhaps each option group...