raymondYsheng / CSA_Repo

MIT License
0 stars 0 forks source link

CSA 2015 FRQ #16

Open raymondYsheng opened 9 months ago

raymondYsheng commented 9 months ago

Show how FRQs or principles of FRQs are incorporated into to your final project.

FRQ 1 (Arrays/Arraylists + 2D Arrays):

This FRQ worked around one dimensional and two dimensional arrays. It dealt with basic iteration and working with arrays, which we use to some extent in our project. We primarily use ArrayLists in our project, namely with our QRCode generator:

@PostMapping("/newCode")
    public ResponseEntity<QrCode> newCode(@RequestBody QrCodeRequest qrCodeRequest) {
        QrCode qrCode = new QrCode();

        List<String> links = qrCodeRequest.getLinks();
        List<Double> frequencys = qrCodeRequest.getFrequencies(); 

        for (int i = 0; i < links.size(); i ++){
            qrCode.addLink(new LinkFreq(links.get(i), frequencys.get(i)));
        }

        repository.save(qrCode);

        return new ResponseEntity<>(qrCode, HttpStatus.OK);
    }

We use a List in order to have a data structure that we can modify the size of after initialization, which is especially useful because our QR Code generator is meant to have multiple links to it so that we can have a random assignment of rooms. Our key algorithm using ArrayLists is our /newcode endpoint, which gets the links that we want to include in the QR Code as well as how likely it is that they should be selected when scanning the QR Code. In the future, if we wanted to use a better data structure for our linked datapoints we could use a HashMap, but for now we use Lists to dynamically set the links and frequencies, which is a perk ArrayLists have over simple arrays.

Arrays are an essential data structure, and are a simple data structure to work with, which is why they are used in PBL. This connects to the FRQ because ArrayLists are an elevated version of arrays and as such can be more versatile when you need a data structure in an project.

FRQ 2 (Classes):

This FRQ works around creating a class to make a game similar to WORDLE. In order to do this I needed to create a class to handle each input to determine how similar a guess is to the true word. We also work with classes in our project:

public class ClassPeriod {

    // automatic unique identifier for Person record
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    // @NonNull, etc placed in params of constructor: "@NonNull @Size(min = 2, max = 30, message = "Name (2 to 30 chars)") String name"
    @NonNull
    @Column(unique=true)
    @Size(min = 2, max = 50, message = "Name (2 to 50 chars)")
    private String name;

    // leaders in the class can control it; not "teachers" because it could be clubs
    @ManyToMany(fetch = EAGER)
    private Collection<Person> leaders = new ArrayList<>();

    // students in the class have fewer permissions
    @ManyToMany(fetch = EAGER)
    private Collection<Person> students = new ArrayList<>();

    @ManyToMany(fetch = EAGER)
    private Collection<Assignment> assignments = new ArrayList<>();

    @JdbcTypeCode(SqlTypes.JSON)
    @Column(columnDefinition = "jsonb")
    private Map<Integer,Map<Integer, String>> seatingChart = new HashMap<>(); 

    // Constructor used when building object from an API
    public ClassPeriod(String name) {
        this.name = name;
        // after the new class is created, before save, a leader must be identified by email and added
    }

    // Initialize static test data 
    public static ClassPeriod[] init() {
        ClassPeriod cp1 = new ClassPeriod("T. Edison's Wacky Science Class");
        ClassPeriod cp2 = new ClassPeriod("Mr. Mort's Period 1 CSA");

        // Array definition and data initialization
        ClassPeriod classPeriods[] = {cp1, cp2};
        return(classPeriods);
    }
}

Our ClassPeriod class has instance variables and methods just like in the FRQ, as well as a constructor to initialize in an object that we use elsewhere.

This is fairly essential to PBL, as classes in Java are essential to OOP. This FRQ can show us the basic structure of a class, which we can then implement further in our project as it is an essential part of creating a working Java backend.

FRQ 3 (Method and Control Structures + 2D Arrays):

This FRQ implemented methods acting on 2D arrays. While we don't use 2D arrays in our project, we do use JSON files. For example, our SeatingChart is sent to the API in the form of a JSON:

{
  "chart": {
    "1": {
      "1": "John",
      "2": "Alice"
    },
    "2": {
      "1": "Bob",
      "2": "Eve"
    }
  },
  "classId": 123
}

Where the chart key includes 2 dictionaries ("1" and "2") representing the tables in the class. The keys in each dictionary represent each person's seat at the table. While this isn't exactly a 2D array, it is somewhat similar that it is a data structure that organizes data in rows and columns. However, unlike a 2D array, the keys in the inner dictionaries are not numeric indices but rather represent specific seats at the tables. This structure allows for more flexibility in representing the seating arrangement and accommodates non-numeric identifiers for the seats.

In the future, if we want to, we can implement 2D arrays as a data structure for storing a different form of data, such as using it for storing information in quizzes, maybe by having one row being a student and another row being the score they got on the quiz.

FRQ 4 (Method and Control Structures):

This FRQ involved creating an interface and inheritance of that interface in different classes. We had to make a contains method that would build off of the interface's contains method.

More specifically, the classes Range and MultipleGroups implemented the NumberGroup interface.

In our project, this is somewhat reflected in the PersonJpaRepository:

public interface PersonJpaRepository extends JpaRepository<Person, Long> {
    Person findByEmail(String email);

    Person findByUsn(String usn);

    List<Person> findAllByOrderByNameAsc();

    List<Person> findByNameContainingIgnoreCaseOrEmailContainingIgnoreCase(String name, String email);

    Person findByEmailAndPassword(String email, String password);

    @Query(
            value = "SELECT * FROM Person p WHERE p.name LIKE ?1 or p.email LIKE ?1",
            nativeQuery = true)
    List<Person> findByLikeTermNative(String term);
}

The PersonJpaRepository extends the JpaRepository, which is a form of inheritance. This differs from implements because extends is for classes and subclass/child classes. Implements is for interfaces that define a set a methods that subclasses can use.

In this case, the PersonJpaRepository is entending the JpaRepository, which the latter being the super class.

This allows for a PBL project to be done with greater efficiency, as sharing methods would mean less lines of code and a greater degree of cohesion in the code.

Overall Reflection

jm1021 commented 9 months ago

I like your analysis a lot.

JPA understanding sticks out as using this feels like magic. Writing about it and understanding it is what we aspire to do.

I like your goals, I have written code from FRQs and even MCQs just for fun and then tried to find PBL or Teaching applicability.

I will put 4 of 3.6 in gradebook when I am not Tim the mountains.

lunaiwa commented 9 months ago

FRQ Grading

College board Rubric

Question 1

Question Check
Part a > arraySum
Part b > rowSums
Part c > isDiverse

Reason: put all frq part together, would rather see in separate cells

Notes: follows all college board requirements, no penalty

Grade:0.9

Question 2

Question Check
HiddenWord

Reason:

Notes: follows all college board requirements, no penalty

Grade:1

Question 3

Question Check
Part a > getValueAt
Part b > removeColumn

Reason:

Notes: follows all college board requirements, no penalty

Grade:0.9

Question 4

Question Check
Part a > NumberGroup
Part b > Range
Part c > contains

Reason:

Notes: follows all college board requirements, no penalty

Grade:0.9

Total : 3.8

lunaiwa commented 9 months ago

PBL Grading

FRQ 1

FRQ 2

FRQ 3

FRQ 4

Everything was explained in a detailed manner and code was provided to explain. Mentioned future goals witht he FRQ themes. Would like it better if in more detail

3.8

jm1021 commented 9 months ago

FRQ Grading

College board Rubric

Question 1

Question Check Part a > arraySum ✅ Part b > rowSums ✅ Part c > isDiverse ✅ Reason: put all frq part together, would rather see in separate cells

  • part a > access and returns the sum
  • part b > construct, acess, computes, returns
  • part c > computes, compares, returns

Notes: follows all college board requirements, no penalty

Grade:0.9

Question 2

Question Check HiddenWord ✅ Reason:

  • implements gethint
  • processed letters within loop

Notes: follows all college board requirements, no penalty

Grade:1

Question 3

Question Check Part a > getValueAt ✅ Part b > removeColumn ✅ Reason:

  • part a > acesss, identify, returns
  • part b > process entries with column index > col within loop

Notes: follows all college board requirements, no penalty

Grade:0.9

Question 4

Question Check Part a > NumberGroup ✅ Part b > Range ✅ Part c > contains ✅ Reason:

  • part a > visible and not private (would lose points if so)
  • part c > calls and computes

Notes: follows all college board requirements, no penalty

Grade:0.9

Total : 3.8

This looks like a lot of attention to detail in crossover analysis. Good attention to detail.

jm1021 commented 9 months ago

PBL Grading

FRQ 1

  • uses the 2d array in the qr code generator

FRQ 2

  • classes, compares 2 frq to game similar to wordle

FRQ 3

  • uses the method and control structures in the seating chart
  • talks about future plans of implementing 2d arrays

FRQ 4

  • made contains method building off of the interface method

Everything was explained in a detailed manner and code was provided to explain. Mentioned future goals witht he FRQ themes. Would like it better if in more detail

3.8

In this type of dialog, it could be more about what you observed or thought as well. Two way conversation.