Skip to content

Commit

Permalink
improved UI
Browse files Browse the repository at this point in the history
  • Loading branch information
nehagundecha95 committed Jun 8, 2018
1 parent 8fad7c0 commit 1a1f81e
Show file tree
Hide file tree
Showing 15 changed files with 150 additions and 135 deletions.
243 changes: 129 additions & 114 deletions .idea/workspace.xml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions components/Assignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class Assignment extends React.Component {
refresh(){
const {navigation} = this.props;
console.log("in refresh")
fetch("http://10.0.0.138:8080/api/lesson/" + this.state.lessonId + "/assignment")
fetch("http://localhost:8080/api/lesson/" + this.state.lessonId + "/assignment")
.then(response => (response.json()))
.then(widgets => {
console.log("here:", widgets);
Expand All @@ -31,15 +31,15 @@ export default class Assignment extends React.Component {
this.setState({
lessonId: lessonId
})
fetch("http://10.0.0.138:8080/api/lesson/" + lessonId + "/assignment")
fetch("http://localhost:8080/api/lesson/" + lessonId + "/assignment")
.then(response => (response.json()))
.then(widgets => {
console.log("here:", widgets);
this.setState({widgets: widgets})
})
}
componentWillReceiveProps(){
fetch("http://10.0.0.138:8080/api/lesson/" + this.state.lessonId + "/assignment")
fetch("http://localhost:8080/api/lesson/" + this.state.lessonId + "/assignment")
.then(response => (response.json()))
.then(widgets => {
console.log("here:", widgets);
Expand Down
2 changes: 1 addition & 1 deletion components/CourseList.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class CourseList extends React.Component {
static navigationOptions = {title: 'Courses'}
constructor(props) {
super(props)
fetch('http://10.0.0.138:8080/api/course')
fetch('http://localhost:8080/api/course')
.then(response => (response.json()))
.then(courses => {
// console.log(courses)
Expand Down
2 changes: 1 addition & 1 deletion components/LessonList.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class LessonList extends Component {
courseId: courseId,
moduleId: moduleId
});
fetch('http://10.0.0.138:8080/api/course/'+courseId+'/module/'+moduleId+'/lesson')
fetch('http://localhost:8080/api/course/'+courseId+'/module/'+moduleId+'/lesson')
.then(response => (response.json()))
.then(lessons => this.setState({lessons: lessons}))
}
Expand Down
2 changes: 1 addition & 1 deletion components/ModuleList.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ModuleList extends Component {
this.setState({
courseId: courseId
})
fetch('http://10.0.0.138:8080/api/course/' + courseId + '/module')
fetch('http://localhost:8080/api/course/' + courseId + '/module')
.then(response => (response.json()))
.then(modules => this.setState({modules: modules}))
}
Expand Down
2 changes: 1 addition & 1 deletion components/QuestionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class QuestionList extends Component {
examId: examId
})

fetch("http://10.0.0.138:8080/api/exam/"+examId+"/question")
fetch("http://localhost:8080/api/exam/"+examId+"/question")
.then(response => (response.json()))
.then(questions => this.setState({questions: questions}))
}
Expand Down
2 changes: 1 addition & 1 deletion components/WidgetList.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class WidgetList extends Component {
this.setState({
lessonId: lessonId
})
fetch("http://10.0.0.138:8080/api/lesson/"+lessonId+"/widget")
fetch("http://localhost:8080/api/lesson/"+lessonId+"/widget")
.then(response => (response.json()))
.then(widgets => {console.log("here:",widgets);this.setState({widgets: widgets})})
}
Expand Down
2 changes: 1 addition & 1 deletion elements/AssignmentWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class AssignmentWidget extends React.Component {

if(this.props.navigation.getParam("assignmentId")!==undefined){
assignmentId = this.props.navigation.getParam("assignmentId");
fetch("http://10.0.0.138:8080/api/assignment/" + assignmentId)
fetch("http://localhost:8080/api/assignment/" + assignmentId)
.then(response => (response.json()))
.then(assignment => {
this.setState({hiddenUpdateBtn: true})
Expand Down
2 changes: 1 addition & 1 deletion elements/CreateNewExamWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class CreateNewExamWidget extends React.Component {
this.ExamService = ExamService.instance;
if(this.props.navigation.getParam("examId")!==undefined){
const examId = this.props.navigation.getParam("examId");
fetch("http://10.0.0.138:8080/api/exam/"+examId)
fetch("http://localhost:8080/api/exam/"+examId)
.then(response => (response.json()))
.then(exam => {
this.setState({hiddenUpdateBtn: true});
Expand Down
2 changes: 1 addition & 1 deletion elements/EssayEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class EssayEditor extends React.Component {
}
if(this.props.navigation.getParam("questionId")!==undefined){
const questionId = this.props.navigation.getParam("questionId");
fetch("http://10.0.0.138:8080/api/essay/"+questionId)
fetch("http://localhost:8080/api/essay/"+questionId)
.then(response => (response.json()))
.then(essayQuestion => {
this.setState({hiddenUpdateBtn: true});
Expand Down
6 changes: 3 additions & 3 deletions elements/Exam.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class Exam extends Component {
refresh(){
const {navigation} = this.props;
console.log("in refresh")
fetch("http://10.0.0.138:8080/api/lesson/" + this.state.lessonId + "/exam")
fetch("http://localhost:8080/api/lesson/" + this.state.lessonId + "/exam")
.then(response => (response.json()))
.then(widgets => {
console.log("here:", widgets);
Expand All @@ -33,7 +33,7 @@ export default class Exam extends Component {
this.setState({
lessonId: lessonId
})
fetch("http://10.0.0.138:8080/api/lesson/" + lessonId + "/exam")
fetch("http://localhost:8080/api/lesson/" + lessonId + "/exam")
.then(response => (response.json()))
.then(widgets => (
// console.log("here:", widgets);
Expand All @@ -42,7 +42,7 @@ export default class Exam extends Component {
}
componentWillReceiveProps(){
console.log("lessonId in exam after receving props:", this.state.lessonId)
fetch("http://10.0.0.138:8080/api/lesson/" + this.state.lessonId + "/exam")
fetch("http://localhost:8080/api/lesson/" + this.state.lessonId + "/exam")
.then(response => (response.json()))
.then(widgets => {
console.log("here:", widgets);
Expand Down
8 changes: 4 additions & 4 deletions elements/ExamWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class ExamWidget extends Component {
refresh(){
const {navigation} = this.props;
console.log("in refresh")
fetch("http://10.0.0.138:8080/api/exam/" + this.state.examId + "/question")
fetch("http://localhost:8080/api/exam/" + this.state.examId + "/question")
.then(response => (response.json()))
.then(questions => {
console.log("here:", questions);
Expand All @@ -32,7 +32,7 @@ export default class ExamWidget extends Component {
refresh2(){
const {navigation} = this.props;
console.log("in refresh")
fetch("http://10.0.0.138:8080/api/lesson/" + this.state.lessonId + "/exam")
fetch("http://localhost:8080/api/lesson/" + this.state.lessonId + "/exam")
.then(response => (response.json()))
.then(widgets => {
console.log("here:", widgets);
Expand All @@ -50,7 +50,7 @@ export default class ExamWidget extends Component {
this.setState({
lessonId: lessonId
})
fetch("http://10.0.0.138:8080/api/exam/" + examId + "/question")
fetch("http://localhost:8080/api/exam/" + examId + "/question")
.then(response => (response.json()))
.then(questions => {
// console.log("here:", widgets);
Expand All @@ -59,7 +59,7 @@ export default class ExamWidget extends Component {
})
}
componentWillReceiveProps(){
fetch("http://10.0.0.138:8080/api/exam/" + this.state.examId + "/question")
fetch("http://localhost:8080/api/exam/" + this.state.examId + "/question")
.then(response => (response.json()))
.then(questions => {
console.log("here:", questions);
Expand Down
2 changes: 1 addition & 1 deletion elements/FillInTheBlanksEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class FillInTheBlanksEditor extends React.Component {
}
if(this.props.navigation.getParam("questionId")!==undefined){
const questionId = this.props.navigation.getParam("questionId");
fetch("http://10.0.0.138:8080/api/blanks/"+questionId)
fetch("http://localhost:8080/api/blanks/"+questionId)
.then(response => (response.json()))
.then(fillInTheBlanksQuestion => {
this.setState({hiddenUpdateBtn: true});
Expand Down
2 changes: 1 addition & 1 deletion elements/MultipleChoiceQuestionEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MultipleChoiceQuestionEditor extends React.Component {
}
if(this.props.navigation.getParam("questionId")!==undefined){
const questionId = this.props.navigation.getParam("questionId");
fetch("http://10.0.0.138:8080/api/multi/"+questionId)
fetch("http://localhost:8080/api/multi/"+questionId)
.then(response => (response.json()))
.then(MultipleChoiceQuestion => {
this.setState({hiddenUpdateBtn: true});
Expand Down
2 changes: 1 addition & 1 deletion elements/TrueFalseQuestionEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TrueFalseQuestionEditor extends React.Component {
}
if(this.props.navigation.getParam("questionId")!==undefined){
const questionId = this.props.navigation.getParam("questionId");
fetch("http://10.0.0.138:8080/api/truefalse/"+questionId)
fetch("http://localhost:8080/api/truefalse/"+questionId)
.then(response => (response.json()))
.then(trueFalseQuestion => {
this.setState({hiddenUpdateBtn: true});
Expand Down

0 comments on commit 1a1f81e

Please sign in to comment.