Tinfo 431 Chapter 1-6 Quiz

55 Questions

Settings
Please wait...
Component Quizzes & Trivia

55 questions 55 minutes.


Questions and Answers
  • 1. 
    Which MVC component group receives the request from the application's user and deals with event handling?
    • A. 

      Model

    • B. 

      View

    • C. 

      Controller

    • D. 

      CLR

  • 2. 
    Which MVC component represents a set of classes that describe the business logic of the application?
    • A. 

      Model

    • B. 

      View

    • C. 

      Controller

    • D. 

      CLR

  • 3. 
    The de facto standard wizard setting selections for creating an ASP.NET MVC web application include all the following except:
    • A. 

      A separate project for unit testing.

    • B. 

      Individual user accounts for authentication.

    • C. 

      Hosting the application in a Windows Azure cloud account.

    • D. 

      Integration of Web Forms and Web API code along with MVC.

  • 4. 
    The default project generated by Visual Studio gives you 2 Controllers by default:
    • A. 

      ContactController

    • B. 

      HomeController

    • C. 

      AboutController

    • D. 

      AccountController

  • 5. 
    The default Views in an MVC project will supply you with 3 subdirectories of cshtml files, named:
    • A. 

      File

    • B. 

      Account

    • C. 

      About

    • D. 

      Home

    • E. 

      Contact

    • F. 

      Shared

  • 6. 
    The generated Visual Studio default web site gives you the functionality of all the following pages:
    • A. 

      Home page

    • B. 

      Contact page

    • C. 

      Account login

    • D. 

      Account logout

    • E. 

      Site map page

    • F. 

      Unhandled error page

    • G. 

      About page

    • H. 

      Account registration

  • 7. 
    The default behavior of the HomeController is to take requests for index, about, or contact pages and return a:
    • A. 

      Response object

    • B. 

      Redirect URL

    • C. 

      View

    • D. 

      Model

  • 8. 
    The MVC framework can use a Controller to put text in the browser as a response to a request, without using either a Model or a View.
    • A. 

      True. Controllers can do this on their own.

    • B. 

      False. Behind the scenes, a Model and a View are being invoked. Controllers don't do anything by themselves.

  • 9. 
    The HttpUtility.HtmlEncode utility method (select all that apply):
    • A. 

      Provide the correct URL link from a friendly search string

    • B. 

      Prevents users from injecting JavaScript code or HTML markup into the view for malicious reasons.

    • C. 

      Can only be used with a GET, not a POST

    • D. 

      Works only on HTML, not on the JavaScript, there is a separate scrubber for JS.

  • 10. 
    MVC Views are part of a templating system which can dynamically replace tags in front end html code withvalues from the application.
    • A. 

      True. Views are fed data from the interaction with the Model and the Controller.

    • B. 

      False. Views are a traditional user interface component.

  • 11. 
    An MVC View will render its data to the user:
    • A. 

      Simply by pointing a browser at the View's address.

    • B. 

      When instructed to do so by a Controller, and (usually) after getting data to display from a Model.

  • 12. 
    Strongly typed Views have all of the following benefits except:
    • A. 

      Allow you to set a Model class type for a View

    • B. 

      IntelliSense help from Visual Studio

    • C. 

      Allows ViewBag to efficiently deal with large quantities of data

    • D. 

      Compiler is checking the syntax of your code

  • 13. 
    Not as robust as strongly typed View(s), but often used to pass smaller amounts of data from the Controller to a View to be rendered.
    • A. 

      GridBag

    • B. 

      ViewBag

    • C. 

      ViewData

    • D. 

      MVC

  • 14. 
    In the following code fragment from a View cshtml file, the "@" symbol is:
    • A. 

      Telling the user that what follows is an email domain name.

    • B. 

      Telling the Razor view engine that what follows is code, not HTML text.

    • C. 

      Telling the browser that what follows is a return to normal HTML

    • D. 

      Telling the browser to interpret what follows as JavaScript.

  • 15. 
    When a controller action has the code "return View();" this is taking advantage of an implicit convention in the MVC framework that:
    • A. 

      Doesn't have to specify the View's folder because each action method has a folder and is called through the MVC routing mechanism.

    • B. 

      Doesn't have to specify the View's filename because each controller folder contains a view file named for each action method.

    • C. 

      It is returning View because these simple examples are handling everything within the controller, there is no View.

    • D. 

      It is returning a new View object that is empty.

  • 16. 
    To override the behavior described above, if you wanted to return the View, /Views/Home/NotIndex.cshtml youwould code:
    • A. 

      Return View("/Home/NotIndex.cshtml");

    • B. 

      Return View("NotIndex");

    • C. 

      Return "/Home/NotIndex.cshtml";

    • D. 

      Return new View("NotIndex");

  • 17. 
    In a strongly typed view, setting a model type for a view, you can use which C# using statement in place of thefully qualified type name @ model IEnumerable<MvcMusicStore.Models.Album>?
    • A. 

      @using MvcMusicStore.Models.Album

    • B. 

      @using MvcMusicStore.Models.*Íž

    • C. 

      @using MvcMusicStore.Models

    • D. 

      @using IEnumerable

  • 18. 
    When you create a View from the dialog, you can choose from some scaffold templates. MVC has which of the following?
    • A. 

      Create

    • B. 

      Delete

    • C. 

      Search

    • D. 

      Details

    • E. 

      Edit

    • F. 

      Empty (with or without a Model)

    • G. 

      List

  • 19. 
    Which MVC component represents a set of classes that describe the business logic of the application?
    • A. 

      Model

    • B. 

      View

    • C. 

      Controller

    • D. 

      CLR

  • 20. 
    Models in an MVC application are the objects you want to (choose all that apply):
    • A. 

      Display (send to a view)

    • B. 

      Save

    • C. 

      Create

    • D. 

      Update

    • E. 

      Delete

    • F. 

      Perform business calculations

  • 21. 
    Model classes are typical C# data object classes with (select all that apply):
    • A. 

      Public properties

    • B. 

      Get operations

    • C. 

      Set operations

    • D. 

      Instance variable storage

    • E. 

      Auto-implemented properties

    • F. 

      Utility methods such as print, ToString, etc.

  • 22. 
    Models are implemented in:
    • A. 

      Cshtml files (as partial classes)

    • B. 

      JavaScript files (as JavaScript classes)

    • C. 

      C# (.cs) files (as C# classes)

    • D. 

      XAML files

  • 23. 
    Scaffolding can do all of the following (select all that applies):
    • A. 

      Examine the Model definition and generate a Controller

    • B. 

      Generate the generated Controller's associated Views

    • C. 

      Generate boilerplate for CRUD operations in the app

    • D. 

      Generate the business rule logic that your application addresses, such as selling flowers, etc.

  • 24. 
    So far in this course, we have focused on the scaffolding for which:
    • A. 

      MVC 5 Controller with read/write Actions

    • B. 

      MVC 5 Controller with Views, Using Entity Framework

    • C. 

      Web API 2 API Controller Scaffolders

    • D. 

      MVC 5 Controller - Empty

  • 25. 
    The Entity Framework supports the following approaches (select all that apply):
    • A. 

      Database-first

    • B. 

      Model-first

    • C. 

      View-first

    • D. 

      Code-first

    • E. 

      Controller-first

  • 26. 
    The EF uses a special table to help keep updated on changes between the code-first models and the database schema. In current MVC 5 this is:
    • A. 

      EdmMetaData table

    • B. 

      __MigrationHistory

    • C. 

      EntityFramework

    • D. 

      Model-Controller sync tool

  • 27. 
    What advantages are there to Model binding? (select all that apply)
    • A. 

      Makes it easier to pull all fields from a model based on various different data types of the properties in the model

    • B. 

      Can search through the query string, route data, or the form collection to find values that need binding.

    • C. 

      Can automatically detect a security concern of an over-posting attack by not binding an unexpected value

  • 28. 
    Why is it important for MVC programmers to cover the HTML Form tag in such depth (select all that apply):
    • A. 

      Without the Form tag, the internet would be a read-only repos of documentation (Web 1.0)

    • B. 

      MVC uses the form tag to create an HTTP GET request.

    • C. 

      Using the form tag keeps web developers in sync with the intended utilization of GET and POST.

    • D. 

      ASP.NET supports the form tag in the use of Web Forms, but developers coming from that background will have additional support mechanisms to learn for MVC.

    • E. 

      MVC uses the form tag to create an HTTP POST request.

  • 29. 
    HTML helpers address all of the following web site code challenges except:
    • A. 

      Methods you can invoke on the Html property in a View

    • B. 

      Make sure that URLs point to the correct locations

    • C. 

      Inject data values into your HTML using the Razor tags

    • D. 

      HTML form elements have the correct names and values for model binding

  • 30. 
    MVC framework gives you access to the following helpers except:
    • A. 

      URL helpers (via the Url property)

    • B. 

      Ajax helpers (via the Ajax property)

    • C. 

      URL helper from within the controller

    • D. 

      JSon helper from the data store

  • 31. 
    The entire internet world of online commerce would crumble tomorrow if the form tag went away (according to one author of the book) because without it you would not be able to search for anything or execute a transaction on a server.
    • A. 

      True

    • B. 

      False

  • 32. 
    This line of code is an example of using Routes.GetVirtualPath(), which will pull in all the routes you application has registered. These are located in which file?
    • A. 

      Startup.cs

    • B. 

      Global.asax

    • C. 

      Bootstrap.css

    • D. 

      RouteConfig.cs

  • 33. 
    MVC Views have Helpers for more than just the HTML property. There are Helpers for which of the following View properties?
    • A. 

      HTML

    • B. 

      JavaScript

    • C. 

      Ajax

    • D. 

      URL

    • E. 

      C# auto-implemented property

  • 34. 
    Many helpers, such as the TextArea Helper output values that are HTML encoded. This is to help mitigate what kind of attacks?
    • A. 

      SQL injection

    • B. 

      Phishing

    • C. 

      Cross-site scripting

    • D. 

      Buffer overflow

    • E. 

      DHCP starvation attack

  • 35. 
    If you type: '@Html.' and after typing the dot, the IntelliSense popup window shows a method name with a small down arrow to the left of the name, it means that the method is what kind?
    • A. 

      Regular instance method

    • B. 

      Expansion method

    • C. 

      One of the HtmlHelper built-in extension methods

    • D. 

      Public override method

  • 36. 
    From the standpoint of ASP.NET MVC, validation is all of the following except:
    • A. 

      Client validation on a web site that can give a user instant feedback on the information they enter into a form

    • B. 

      A feature that is more or less expected in today's web applications

    • C. 

      Server validation logic is in place because your application should never trust information arriving from the network.

    • D. 

      Validation of what is already in the database

  • 37. 
    The validation support in MVC includes which of the following (select all that apply):
    • A. 

      Client side validation

    • B. 

      Server side validation

    • C. 

      Handling of user interface issues associated with display of error messages

    • D. 

      Providing some mechanism for users to recover from validation failures

    • E. 

      Database normalization

  • 38. 
    Validation in the MVC design pattern context deals mostly with validating against:
    • A. 

      Models

    • B. 

      Views

    • C. 

      Controller logic

    • D. 

      All of the above

  • 39. 
    Many MVC validation annotations include an option for a custom error message to be displayed.
    • A. 

      True

    • B. 

      False

  • 40. 
    If the built-in validation annotations do not fit your scenario, you can custom code your own validations. To do this you would extend the class:
    • A. 

      AttributeValidate

    • B. 

      ValidateAttribute

    • C. 

      ValidationAttribute

    • D. 

      PleaseCheckMyValue

  • 41. 
    Self-validating models can be created by implementing which interface?
    • A. 

      IModelValidation

    • B. 

      IValidateObject

    • C. 

      IValidatableObject

    • D. 

      ICheckEmForErrors

  • 42. 
    Multiple Validation Annotations can be applied to a C# property by simply listing them above the property one on top of the next. For example:
    • A. 

      True

    • B. 

      False