Skip to content
Snippets Groups Projects
Commit a0513fd2 authored by tudtianus's avatar tudtianus
Browse files

fix: Updated Journal Interface

parent a733ea1e
No related branches found
No related tags found
No related merge requests found
package unipotsdam.gf.interfaces;
import unipotsdam.gf.modules.journal.JournalEntry;
import unipotsdam.gf.modules.assessment.controller.StudentIdentifier;
/**
* Interface for learning journal entry
* Interface for learning journal
*/
public interface IJournal {
/**
* Enum for visibility
*/
enum Visibility{ALL, STUDENT, DOZENT, NONE}
/**
* Add a new journal entry
*
* @param text text of the entry
* @param visibility visibility of the entry
*/
void addJournal(String text, Visibility visibility);
/**
* Change an existing journal entry
*
* @param newText the new text
*/
void editJournal(String newText);
/**
* Delete a journal entry
*
* @param journaId id of the entry
*/
void deleteJournal(long journaId);
/**
* change visibility of an entry
* @param journaId id of the entry
* @param visibility new visibility
*/
void setVisibility(long journaId, Visibility visibility);
/**
* Get specific journal entry
*
* @param journaId id of the entry
* @return JournalEntry from database
*/
JournalEntry getJournal(long journaId);
public interface IJournal {
/**
* Get all JournalEntry for a project
*
* @param projectId id of project
* @return all JournalEnrys for that project
* Exports the learning journal
* @param student StudentIdentifier
* @return the journal as String (may change)
*/
JournalEntry getAllJournalEntrysProject(long projectId);
String exportJournal (StudentIdentifier student);
}
package unipotsdam.gf.modules.journal;
import unipotsdam.gf.interfaces.IJournal;
/**
* Prototype of JournalEntry Class
*/
public class JournalEntry {
long id;
long owner;
long project;
long timestamp;
IJournal.Visibility visibility;
String text;
public JournalEntry() {
}
public JournalEntry(long id, long owner, long project, long timestamp, IJournal.Visibility visibility, String text) {
this.id = id;
this.owner = owner;
this.project = project;
this.timestamp = timestamp;
this.visibility = visibility;
this.text = text;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getOwner() {
return owner;
}
public void setOwner(long owner) {
this.owner = owner;
}
public long getProject() {
return project;
}
public void setProject(long project) {
this.project = project;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
public IJournal.Visibility getVisibility() {
return visibility;
}
public void setVisibility(IJournal.Visibility visibility) {
this.visibility = visibility;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
@Override
public String toString() {
return "JournalEntry{" +
"id=" + id +
", owner=" + owner +
", project=" + project +
", timestamp=" + timestamp +
", visibility=" + visibility +
", text='" + text + '\'' +
'}';
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment