Sample CodemacOSReviewed 2026-07-21View on Apple Developer

Build an Educational Assessment App

At a glance

Item Summary
Purpose Ensure the academic integrity of your assessment app by using Automatic Assessment Configuration.
App architecture A C/Objective-C header, Objective-C, Swift sample with the source-visible chain AppDelegateLogViewControllerAutomaticAssessmentConfiguration APIs.
Main patterns Delegate or data-source callbacks
Project style 11 scanned source file(s) across C/Objective-C header, Objective-C, Swift, organized around ranked entry, type, and file boundaries.

Project structure

Source bundle/
├── Assessment Time/
│   ├── Swift/
│   │   ├── AppDelegate.swift
│   │   ├── WindowController.swift
│   │   ├── LogViewController.swift
│   │   └── ViewController.swift
│   └── Objective-C/
│       ├── main.m
│       ├── WindowController.m
│       ├── LogViewController.m
│       ├── ViewController.m
│       ├── LogViewController.h
│       ├── ViewController.h
│       └── WindowController.h
└── Assessment Time - SwiftUI.entitlements

Structure observations

  • Architecturally prominent files are ranked from entry points and role-named declarations; resource-only paths are omitted.
  • Primary languages: C/Objective-C header, Objective-C, Swift.
  • The verified tree contains 6 project/configuration file(s) and 7 source declaration(s).

Overall architecture

Reference code

Assessment Time/Swift/AppDelegate.swift:11 — architecture anchor

@main
@objc(AppDelegate)
class AppDelegate: NSObject, NSApplicationDelegate {

}

Interpretation

The arrows summarize the source-visible entry, role-named types or folders, and framework direction; when nodes come from structural folders, the sequence is a high-level interpretation rather than proof that every adjacent node calls the next. Ownership is claimed only where the next section cites a stored property or assignment. The diagram is intentionally limited to the dominant path into Automatic Assessment Configuration.

Ownership and state

Ownership evidence

Assessment Time/Objective-C/WindowController.m:11 — stored dependency or nearest verified ownership anchor

@property (weak) IBOutlet NSToolbarItem *lockUnlockItem;
@property (weak) IBOutlet NSSegmentedControl *calculatorOptions;
@property (weak) IBOutlet NSSegmentedControl *dictionaryOptions;
- (IBAction)lockSession:(id)sender;

@property AEAssessmentSession *session;
Owner Object or state Relationship Mutation authority
WindowController NSToolbarItem (lockUnlockItem) holds a non-owning reference The referenced object’s lifecycle is owned elsewhere
WindowController NSSegmentedControl (calculatorOptions) holds a non-owning reference The referenced object’s lifecycle is owned elsewhere
WindowController NSSegmentedControl (dictionaryOptions) holds a non-owning reference The referenced object’s lifecycle is owned elsewhere
WindowController AEAssessmentSession (session) stores or receives Owning Objective-C implementation

Composition arrows indicate a source-visible construction expression or locally owned value state; aggregation means the owner stores or receives a dependency without proving exclusive lifetime ownership.

Class and protocol design

Assessment Time/Swift/AppDelegate.swift:13 — representative type boundary

class AppDelegate: NSObject, NSApplicationDelegate {

}
Type Responsibility Depends on or conforms to
AppDelegate Receives callback-driven events NSObject, NSApplicationDelegate
WindowController View lifecycle, callbacks, and feature coordination NSWindowController
LogViewController View lifecycle, callbacks, and feature coordination NSViewController
ViewController View lifecycle, callbacks, and feature coordination NSViewController
WindowController View lifecycle, callbacks, and feature coordination NSWindowController
LogViewController View lifecycle, callbacks, and feature coordination NSViewController
ViewController View lifecycle, callbacks, and feature coordination NSViewController

No local protocol conformance is claimed as protocol-oriented design; external framework conformances are listed only as dependencies.

Access control

Symbol Access Verified effect Likely rationale
logTextView (Assessment Time/Objective-C/LogViewController.m:11) implementation Visibility follows header/implementation and language linkage rules. Inference: keep the declaration in the Objective-C implementation boundary.
formatter (Assessment Time/Objective-C/LogViewController.m:12) implementation Visibility follows header/implementation and language linkage rules. Inference: keep the declaration in the Objective-C implementation boundary.
urlField (Assessment Time/Objective-C/ViewController.m:11) implementation Visibility follows header/implementation and language linkage rules. Inference: keep the declaration in the Objective-C implementation boundary.
webView (Assessment Time/Objective-C/ViewController.m:12) implementation Visibility follows header/implementation and language linkage rules. Inference: keep the declaration in the Objective-C implementation boundary.

Reference code

Assessment Time/Objective-C/LogViewController.m:11 — representative boundary

@interface LogViewController ()
@property (weak) IBOutlet NSTextView *logTextView;
@property (strong) NSDateFormatter *formatter;
@end

Swift declarations without a modifier are internal; explicit private, fileprivate, private(set), public, or open entries above are interpreted by language semantics. Objective-C/C samples instead rely on header and implementation boundaries, which are not equivalent to Swift lexical privacy.

Logic ownership and placement

Logic Owning type or file Placement rationale
View lifecycle, callbacks, and feature coordination LogViewController, ViewController, WindowController The source’s Controller suffix makes this role explicit.
Receives callback-driven events AppDelegate The source’s Delegate suffix makes this role explicit.

Design patterns

Pattern Source evidence Purpose or tradeoff
Delegate or data-source callbacks Assessment Time/Swift/AppDelegate.swift:13 Callback protocols invert event delivery back into the sample’s owner.

Naming conventions

  • Types: Controller: LogViewController, ViewController, WindowController; Delegate: AppDelegate.
  • Protocols: no local protocol declaration in the scanned source.
  • Methods: lockSession, windowDidLoad, setupAssessmentSession, participantConfiguration, attemptToOpenAppWithBundleID, updateConfiguration, updateLockButton, log.
  • Files: Assessment Time/Swift/AppDelegate.swift, Assessment Time/Objective-C/WindowController.m, Assessment Time/Swift/WindowController.swift, Assessment Time/Objective-C/LogViewController.m, Assessment Time/Objective-C/ViewController.m, Assessment Time/Objective-C/LogViewController.h.

Architecture takeaways

  • AppDelegate is the main source-visible entry or composition anchor for this sample.
  • Framework work reaches Cocoa, AutomaticAssessmentConfiguration, WebKit through a deliberately small high-level chain; the detailed API graph remains inside the cited implementation files.
  • Stored-property evidence identifies lifecycle collaboration; it does not by itself prove exclusive object ownership.
  • Access-control conclusions separate verified language visibility from the likely design rationale.
  • The source does not justify labeling the design protocol-oriented.

Source map

Source file Relevant symbols
Assessment Time/Swift/AppDelegate.swift AppDelegate
Assessment Time/Objective-C/main.m Feature implementation
Assessment Time/Objective-C/WindowController.m WindowController, WindowController, WindowController
Assessment Time/Swift/WindowController.swift WindowController
Assessment Time/Objective-C/LogViewController.m LogViewController, LogViewController
Assessment Time/Objective-C/ViewController.m ViewController, ViewController
Assessment Time/Objective-C/LogViewController.h LogViewController
Assessment Time/Objective-C/ViewController.h ViewController
Assessment Time/Objective-C/WindowController.h WindowController
Assessment Time/Swift/LogViewController.swift LogViewController