4.2 Server Side Grader Model For Rails Framework
4.2.1 Feedback
Posting feedback for the submission was key in allowing students to view and correct their mistakes. It was important to have a good understanding of how the grader
might encounter issues and provide students with enough information to fix their Rails application.
Feedback string assignment will be explained below. Sometimes the feedback was static, while other times it might need to be dynamic.
Invalid URL
If the student submits an invalid URL, this is the canned response that they will see as the feedback after the submission is graded.
“The submission does not contain a valid URL. Please fix the URL in the text file and submit the assignment again.”
Unable to Clone Repository
If there was an issue when cloning the repository from the valid URL, the student would receive the feedback listed below. In this situation, the most likely cause was that the URL, albeit valid, was not pointing to a git repository. The other possible cause was that the Git repository was not granted public access permissions by the student.
“Error when cloning the repository. Please make sure the url provided is a working BitBucket repository and the access level is set to public and submit the assignment again.”
Repository Does Not Contain Rails Application
In the event that the repository was successfully cloned, but the master repository folder does not contain an app folder, db folder, or config/routes.rb file, the grader would assume that the repository did not contain a valid Rails application. In this case, the following feedback string would be posted for the student to view.
“Error when moving either the app folder, db folder, or config/routes.rb file from your repository to our test repository. Please make sure that your Bitbucket repository contains a Rails application and that it is not located in a subdirectory. Then, please submit the assignment again. You may also need to make sure that you are running Rails version >4.0 and Ruby version >2.0”
RSpec Error
The RSpec error was more complex compared to the others outlined. There were many things that might cause such an error, so providing the student with suitable feedback to fix it was a challenge. Again, this was where testing in the MOOC environment was valuable. Hundreds of submissions that failed at this specific step were seen and the cause of such failures were recorded. The causes ranged from duplicate table migrations to an incorrect spelling of a Rails method. Essentially, these were errors that would not allow the Rails application server to run. This evidence has lead to the conclusion that many students did not do any user testing of their application before submitting it. Section 5.3.3 contains a more detailed explanation.
“Submission received, but the grading script was unable to run on the application you provided. It appears that your Rails application is mis- configured. Make sure you follow the Module 6 Lectures 8 and 9 videos closely, and the tests should pass. Review your submission and resubmit it. You may also need to make sure that you are running Rails version >4.0 and Ruby version >2.0.”
“The following error, returned by Rails, may help you in debugging your submission.”
Additionally, if an error occurred during this step, dynamic information specific to the error was provided. The information provided was simply the first line of the error returned from the RSpec command. This supplies insight as to what the issue was for the student to debug their Rails application. An example of what the feedback might look like, when the method dependent is misspelled in the following line of code, can be found below.
has_many :comments, dependant: :destroy
“ERROR: ‘block in assert valid keys’: Unknown key: dependant (Argu- mentError)”
RSpec Test Failure
If the submission had made it this far in the grading script, it meant that the prede- fined RSpec tests had been successfully executed on the student’s Rails application. Now the student needed to know which RSpec tests they failed and how to correct them. RSpec provided some very nice formatting when one of the tests fails. For
this section, the RSpec output was appended to fit the feedback if any of the tests failed. Also, because Coursera allowed the use of HTML in their feedback, highlight- ing was added to make it more obvious which parts of the returned feedback were most important.
‘Submission received. This means that the submitted repository has been verified and contains a Rails application. For this, you are automatically rewarded 40% of the points. The remaining 60% of your grade is cal- culated from the running rspec tests on your application. If you follow the Module 6 Lectures 8 and 9 videos, the tests should pass. If you are missing points, you may want to rewatch the video(s) for this assignment.
You may review the rspec test output below.
7) PostsController GET show renders comment partial
Failure/Error: response.should render template(:partial =>” comment”) expecting partial < comment>but action rendered <[]>. Expected{} to include ” comment”.’
This feedback gave an indication that the comment partial was not rendered properly. Perhaps the comment partial did not exist or was misspelled. Another great thing about the MOOC was that if a student receives this RSpec failure message but does not fully understand it, they might create a discussion thread asking for help and other students would congregate and assist in finding a solution.
Well Done
Finally, students were informed and congratulated upon correct completion of their submission.
“Your submission has received full credit. Good Job!”