Conversation so far:
who was the first american president to be photographed
John Quincy Adams, the sixth President of the United States, was the first president to have his photograph taken.

Question: when was the president in office
Self-contained rewrite: when was john quincy adams in office