0% found this document useful (0 votes)
42 views5 pages

Exam 1

The exam focuses on web2.0 technologies and mobile terminal programming. It contains 17 multiple-choice questions on topics such as frameworks, Symfony, Doctrine entities, class relationships, and Twig.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views5 pages

Exam 1

The exam focuses on web2.0 technologies and mobile terminal programming. It contains 17 multiple-choice questions on topics such as frameworks, Symfony, Doctrine entities, class relationships, and Twig.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

EXAM

1 2
Main Session Catch-up

Teaching unit: Web & mobile development


Module(s): Web2.0 Technologies / Mobile Terminal Programming
Class(es): 4INFOB
Number of questions: Number of pages:
20/07/2020 Time 9:45 AM Duration: 1 hour

Part I: Web2.0 Technologies

What is the definition of a framework?


A website to configure, C-A rigid black box to use.
like a CMS.
B-A toolbox for D-Permits to structure the project without
developers offer components and
libraries to use
2. What is the role of the controller in Symfony?
A-Return to the core of the content C-Display an HTML page
HTML
B-Return to the core an answer D-Return a response to the core
with only HTML content with any content

3. What is the definition of a front controller? (Outside Program)


He checks that the visitor is indeed C-It converts a request into a
identified on the site response thanks to the core
He controls the request D-It is represented by the file
/web/app_dev.php

4. What is the role of dataType in an Ajax request? (Outside Program)


Specify the type of content sent C- Specify the type of content sent
B-Specify the type of content received and received
D-Specify the address where the request is
sent

We consider the following class diagram:

Reservation
Hotel Id
1 * Date_Res
ref
Name Number of people
Address

5. What is the correct syntax to have the non-auto-increment ref attribute?


A-/*
* @var int type="integer"
* * @ORM\ref
* @ORM@Column(name="ref", @ORM\GeneratedValue(strategy="AUTO")

1
*/ type="integer"
private $ref; * @ORM\Id
*/
B-/** private $ref;
* @var int
* D-/**
* @ORM@Column(name="ref", * @var int
type="integer" *
* @ORM\ref * @ORM@Column(name="ref",
*/ type="integer"
private $ref; * @ORM\Id
*
C-/** @ORM\GeneratedValue(strategy="AUT
* @var int O")
* */
* @ORM\Column(name="ref", private $ref;

6. What is the command that allows you to generate an entity?

A-php bin/console make:entity C-php bin/console generate:bundle:entity


B-php bin/console generate_entity D-php bin/console
doctrine:generate:entity

What is the command that allows you to create the database?

A-php bin/console database: create C-php bin/console doctrine: database:


B-php bin/console doctrine : database: create --force
create D-php bin/console doctrine : database:
generate

8. Where are the CSS files of the project located? (Outside Program)
Under the src folder C-Under the app folder
B-Under the web folder D-Under the config folder

9. In which directory are the executable files located?


A-app C-var
B-bin D-web

10. Knowing that the class 'Reservation' is linked to the class 'Hotel' by the 'ManyToOne' relationship,
What is the correct syntax to add in the Reservation entity?

A-/**
*
* @ORM\ManyToOne(targetEntity="Hotel")
* @ORM\JoinColumn(name="hotel_id", referencedColumnName="ref")
*/
private $hotel;

B-/**
*
* @ORM elationManyToOne(targetEntity="Hotel")
* @ORM\JoinColumn(name="hotel_id", referencedColumnName="id")

2
*/
private $hotel;

C-/**
*
* @ORM\x48anyToOne(targetEntity="Reservtion")
* @ORM\JoinColumn(name="reservation_id", referencedColumnName="id")
*/
private $reservation;

D-/**
*
* @ORM\ManyToOne(targetEntity="Hotel")
* @ORM\
*/
private $hotel;

11.In which table is the foreign key located?

A-Hotel C-The two tables hotel and


B-Reservation reservation.
D-None of the answers

12. What is the name of the class that the controller inherits from?
A-Controller C-AbstractType
B-Bundle D-FormType
13. What is the code to add a new object '$hotel' of the Hotel class to the database?
data?

A-$hotel = new Hotel(); $em->insert($hotel);


$em = $this->getDoctrine()- $em->flush();
getManager();
$em->persist($hotel);
$em->flush(); D-$hotel = new Hotel();
B-$hotel = new Hotel(); $em = $this->getDoctrine()-
$em = $this->getDoctrine()- getManager();
getManager(); $this->persist($hotel);
$em->persist(); $em->flush();
$em->flush();
C-$hotel = new Hotel();
$em = $this->getDoctrine()-
>getManager();

14. We want to add an attribute nbrReservation that will contain the number of reservations per hotel. The
The associated column must be nbr_reservation. What should the annotation be?
* @ORM\Column(type="integer",
A-/** nullable=true, name="nbrReservation")
* @ORM\Column(type="integer", */
nullable=true, name=" nbr_reservation ") private $ nbr_reservation;
*/
private $nbrReservation; C-/**
B-/** * @ORM\Column(type="integer",
nullable=true, name=" nbr_reservation ")

3
*/ */
private $nbr_reservation; private $nbrReservation;
D-/**
* @ORM@Column(type="integer",
nullable=true, name="nbrReservation")

15. What is the command to update the database? (Outside of Program)

A-php bin/console schema:update C-php bin/console doctrine


B-php bin/console doctrine: database: schema:update
schema:update D-None of the answers is true

16. How can one declare a variable in a Twig view?

A-{% set var %} My text {% My text


endset %} endset %}
My text My text

17. We want to display the name attribute of the Hotel object, in uppercase, in a Twig view. What is
the correct syntax?
A-{% HOTEL.NAME|UPPER %} C-{{ upper($hotel.name) }}
B-{{ upper(hotel.name) }} D-{{ hotel.name | upper }}

18. What is the code used to search for the $hotel object using DQL?
A-public function findHotelParameter($hotel)
{ $query=$this->getEntityManager()->createQuery(
select h from Hotel h where h.hotel=:hotel ->setParameter('hotel', $hotel);
return $query->getQuery()->getResult();
}
B-public function findHotelParameter()
{
$query=$this->getEntityManager()->createQuery(
select h from ExamenEspritBundle:Hotel h where h.hotel=$hotel
setParameter('hotel', $hotel); return $query->getResult();
}
C-public function findHotelParameter($hotel) {
$query=$this->getEntityManager()->createQuery("select h from
ExamenEspritBundle:Hotel h where h.ref=:hotel "->setParameter('hotel', $hotel);
return $query->getResult();}
D-None of these answers is true

19. What is the correct jQuery code to set the background color of all div tags to
out of program
A-$('div').css('background- C-$(" #div").manipulate("background
green d-color","green";
B-$("#div").css("background- D-$('div').layout('background-
green green

20. What is the result provided by this JQuery code? (Outside Program)
$("p").click(function(){$(this).css("color","red").slideUp().slideDown();}

4
Assign the red color to the p tag C-Assign an animation to the p tag
when clicking with animation one upon click
after the other D-None of these answers is true
B-Assign the color red to the p tag
when clicking with animation at the same
weather

You might also like